Skip to content

Commit 4ad8616

Browse files
committed
add SCSS codepoint map in addition to the variables
1 parent 9188eb7 commit 4ad8616

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

lib/fontcustom/templates/_fontcustom-rails.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
[data-icon]:before { content: attr(data-icon); }
88

99
[data-icon]:before,
10+
<%= @options[:css_selector].sub("{{glyph}}", "") %>:before,
1011
<%= glyph_selectors %> {
1112
<%= glyph_properties %>
1213
}
1314

1415
<%= glyphs %>
16+
17+
<% @glyphs.each do |name, value| %>
18+
$font-<%= font_name.gsub(/[^\w\d_]/, '-') %>-<%= name.to_s %>: "\<%= value[:codepoint].to_s(16) %>";<% end %>
19+
$font-<%= font_name.gsub(/[^\w\d_]/, '-') %>: (<% @glyphs.each do |name, value| %>
20+
<%= name.to_s %>: "\<%= value[:codepoint].to_s(16) %>",<% end %>
21+
);

lib/fontcustom/templates/_fontcustom.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
[data-icon]:before { content: attr(data-icon); }
88

99
[data-icon]:before,
10+
<%= @options[:css_selector].sub("{{glyph}}", "") %>:before,
1011
<%= glyph_selectors %> {
1112
<%= glyph_properties %>
1213
}
1314

1415
<%= glyphs %>
16+
1517
<% @glyphs.each do |name, value| %>
1618
$font-<%= font_name.gsub(/[^\w\d_]/, '-') %>-<%= name.to_s %>: "\<%= value[:codepoint].to_s(16) %>";<% end %>
19+
$font-<%= font_name.gsub(/[^\w\d_]/, '-') %>: (<% @glyphs.each do |name, value| %>
20+
<%= name.to_s %>: "\<%= value[:codepoint].to_s(16) %>",<% end %>
21+
);

0 commit comments

Comments
 (0)