Created
March 23, 2017 15:48
-
-
Save ahaywood/2f4babe395cbe5b840c928ed8336cff8 to your computer and use it in GitHub Desktop.
Setting up an icon system - 2 different options. one that establishes the icon with the style, another as a pseudo element.
This file contains hidden or 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
$icons: ( | |
checkmark: a, | |
plus: b, | |
minus: c | |
); | |
/* For each key in the map, created an own class */ | |
@each $name, $value in $icons { | |
.icon--#{$name} { | |
content: $value; | |
} | |
} |
This file contains hidden or 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
$icons: ( | |
glass: "\f000", | |
music: "\f001", | |
search: "\f002", | |
envelope-o: "\f003", | |
heart: "\f004" | |
); | |
@each $name, $icon in $icons { | |
.fa-#{$name}:before { | |
content: $icon; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment