Skip to content

Instantly share code, notes, and snippets.

@alexlouden
Last active December 11, 2017 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexlouden/00285918b19925b3f0f2cc950600f500 to your computer and use it in GitHub Desktop.
Save alexlouden/00285918b19925b3f0f2cc950600f500 to your computer and use it in GitHub Desktop.
Icon font sass
<i class="icon-star"></i>
// Icon font
+font-face(icon-font-name, '/fonts/icon-font-name')
%icon
font-family: 'icon-font-name'
speak: none
font-style: normal
font-weight: normal
font-variant: normal
text-transform: none
line-height: 1
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
[class^="icon-"], [class*=" icon-"]
@extend %icon
@mixin icon($name, $code)
.icon-#{$name}:before
content: "#{$code}"
// List icons and their codes as follows:
+icon(star, \e601)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment