Skip to content

Commit

Permalink
add SCSS codepoint map in addition to the variables
Browse files Browse the repository at this point in the history
  • Loading branch information
odedniv committed Jun 13, 2017
1 parent 776fd0f commit 0d4d70f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/fontcustom/templates/_fontcustom-rails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
[data-icon]<%= pseudo_element %> { content: attr(data-icon); }

[data-icon]<%= pseudo_element %>,
<%= @options[:css_selector].sub("{{glyph}}", "") %><%= pseudo_element %>,
<%= glyph_selectors %> {
<%= glyph_properties %>
}

<%= glyphs %>

<% @glyphs.each do |name, value| %>
$font-<%= font_name.gsub(/[^\w\d_]/, '-') %>-<%= name.to_s %>: "\<%= value[:codepoint].to_s(16) %>";<% end %>
$font-<%= font_name.gsub(/[^\w\d_]/, '-') %>: (<% @glyphs.each do |name, value| %>
<%= name.to_s %>: "\<%= value[:codepoint].to_s(16) %>",<% end %>
);
5 changes: 5 additions & 0 deletions lib/fontcustom/templates/_fontcustom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
[data-icon]<%= pseudo_element %> { content: attr(data-icon); }

[data-icon]<%= pseudo_element %>,
<%= @options[:css_selector].sub("{{glyph}}", "") %><%= pseudo_element %>,
<%= glyph_selectors %> {
<%= glyph_properties %>
}

<%= glyphs %>

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

0 comments on commit 0d4d70f

Please sign in to comment.