Skip to content

Instantly share code, notes, and snippets.

@chipcullen
Last active August 29, 2015 14:27
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 chipcullen/b34394311b1d876d98f8 to your computer and use it in GitHub Desktop.
Save chipcullen/b34394311b1d876d98f8 to your computer and use it in GitHub Desktop.
A Sass list and loop to output icons derived from an icon font. Based on hint from https://github.com/sass/sass/issues/659#issuecomment-71759457
// list of icons
$icons : (
twitter: e603,
facebook: e602,
retweet: e001,
reply-mail: e002,
favorite: e003,
instagram: e600,
pintrest: e601,
youtube: e605,
youtube-2: e604,
tumblr: e606,
tumblr-square: e607,
checkmark: e005,
share: e006
);
// be sure to update 'icon-class-' to be whatever your project requires
@each $icon, $value in $icons {
.icon-class-#{$icon}:before {
content: #{"\"\\"}#{$value + "\""};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment