diff --git a/lib/fontcustom/generator/template.rb b/lib/fontcustom/generator/template.rb index c41b961b..91a88e26 100644 --- a/lib/fontcustom/generator/template.rb +++ b/lib/fontcustom/generator/template.rb @@ -151,6 +151,21 @@ def glyph_selectors output.join ",\n" end + def glyph_properties +%Q| display: inline-block; + font-family: "#{font_name}"; + font-style: normal; + font-weight: normal; + font-variant: normal; + line-height: 1; + text-decoration: inherit; + text-rendering: optimizeLegibility; + text-transform: none; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-smoothing: antialiased;| + end + def glyphs output = @glyphs.map do |name, value| %Q|#{@options[:css_selector].sub('{{glyph}}', name.to_s)}:before { content: "\\#{value[:codepoint].to_s(16)}"; }| diff --git a/lib/fontcustom/templates/_fontcustom-rails.scss b/lib/fontcustom/templates/_fontcustom-rails.scss index 3a2f725e..1cb5637b 100644 --- a/lib/fontcustom/templates/_fontcustom-rails.scss +++ b/lib/fontcustom/templates/_fontcustom-rails.scss @@ -8,16 +8,7 @@ [data-icon]:before, <%= glyph_selectors %> { - display: inline-block; - font-family: "<%= font_name %>"; - font-style: normal; - font-weight: normal; - font-variant: normal; - line-height: 1; - text-decoration: inherit; - text-transform: none; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; +<%= glyph_properties %> } <%= glyphs %> diff --git a/lib/fontcustom/templates/_fontcustom.scss b/lib/fontcustom/templates/_fontcustom.scss index 3a2f725e..1cb5637b 100644 --- a/lib/fontcustom/templates/_fontcustom.scss +++ b/lib/fontcustom/templates/_fontcustom.scss @@ -8,16 +8,7 @@ [data-icon]:before, <%= glyph_selectors %> { - display: inline-block; - font-family: "<%= font_name %>"; - font-style: normal; - font-weight: normal; - font-variant: normal; - line-height: 1; - text-decoration: inherit; - text-transform: none; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; +<%= glyph_properties %> } <%= glyphs %> diff --git a/lib/fontcustom/templates/fontcustom-preview.html b/lib/fontcustom/templates/fontcustom-preview.html index 70bd2b9e..79572f96 100644 --- a/lib/fontcustom/templates/fontcustom-preview.html +++ b/lib/fontcustom/templates/fontcustom-preview.html @@ -127,16 +127,7 @@ [data-icon]:before, <%= glyph_selectors %> { - display: inline-block; - font-family: "<%= font_name %>"; - font-style: normal; - font-weight: normal; - font-variant: normal; - line-height: 1; - text-decoration: inherit; - text-transform: none; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; + <%= glyph_properties %> } <%= glyphs %> diff --git a/lib/fontcustom/templates/fontcustom.css b/lib/fontcustom/templates/fontcustom.css index d9f1b6ec..f5dfd6e2 100644 --- a/lib/fontcustom/templates/fontcustom.css +++ b/lib/fontcustom/templates/fontcustom.css @@ -8,16 +8,7 @@ [data-icon]:before, <%= glyph_selectors %> { - display: inline-block; - font-family: "<%= font_name %>"; - font-style: normal; - font-weight: normal; - font-variant: normal; - line-height: 1; - text-decoration: inherit; - text-transform: none; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; +<%= glyph_properties %> } <%= glyphs %>