Skip to content

Instantly share code, notes, and snippets.

@shaneog
Forked from chipcullen/icons.scss
Created July 7, 2014 21:48
Show Gist options
  • Save shaneog/bd4977c904a61e3537dd to your computer and use it in GitHub Desktop.
Save shaneog/bd4977c904a61e3537dd to your computer and use it in GitHub Desktop.
%icon {
font-family: $icon-font; //set as a variable - it's whatever your icon font name is
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
@mixin icon($content, $position:"") {
@if $position == "" {
@extend %icon;
content: $content;
} @else if $position == before {
&::before {
@extend %icon;
content: $content;
}
} @else if $position == after {
&::after {
@extend %icon;
content: $content;
}
}
}
//usage:
//.foo {
// @include icon('\e001', before);
//}
//or
//.bar {
// &::after {
// @include icon('\e001');
// -- other styles
// }
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment