Created
January 31, 2016 03:18
-
-
Save dillonbailey/f91f6079288e403492e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For adding font icons to elements using CSS pseudo-elements | |
// http://jaydenseric.com/blog/fun-with-sass-and-font-icons | |
// Usage @include icon(before, email, false); | |
@mixin icon($position: before, $icon: false, $styles: true) { | |
@if $position == both { | |
$position: 'before, &:after'; | |
} | |
// Either a :before or :after pseudo-element, or both, defaulting to :before | |
&:#{$position} { | |
@if $icon { | |
// A particular icon has been specified | |
content: "#{map-get($icons, $icon)}"; | |
} | |
@if $styles { | |
// Supportive icon styles required | |
speak: none; | |
font-style: normal; | |
font-weight: normal; | |
font-family: 'honestfox'; | |
// Some more supportive icon styles via icomoon.io | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
line-height: 1; | |
font-variant: normal; | |
} | |
// Include any extra rules supplied for the pseudo-element | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment