Skip to content

Instantly share code, notes, and snippets.

@seafarer
Created March 18, 2014 20:33
Show Gist options
  • Select an option

  • Save seafarer/9628943 to your computer and use it in GitHub Desktop.

Select an option

Save seafarer/9628943 to your computer and use it in GitHub Desktop.
Font face icons in scss
// Start with a mixin
@mixin iconfont {
font-family: "foundation-icons"; // whatever your icon fonts name is
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
display: inline-block;
text-decoration: inherit;
}
// Use it
a {
color: $primary-color;
@include transition(all 300ms ease-in-out);
&:hover {
color: darken($primary-color, 10%);
@include transition(all 300ms ease-in-out);
}
&.facebook {
font: 0/0 sans-serif; // Squish original font to nothingness if you want
&:before {
@include iconfont; // Include mixin from above
content: "\f1c4"; // This is found in your icon font css file and corresponds to the icon you want to use.
font-size: 48px; // Control the size of the icon
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment