1 // https://github.com/sass/sass/issues/659#issuecomment-64819075
2 @function char($character-code) {
3 @if function-exists("selector-append") {
4 @return unquote("\"\\#{$character-code}\"");
7 @return str-slice("\x", 1, 1) + $character-code;
10 $icon-font-family: {{fontName}};
11 $icon-font-path: '../fonts' !default;
14 font-family: $icon-font-family;
15 src: url('#{$icon-font-path}/{{fontName}}.eot?#iefix') format('eot');
18 font-family: $icon-font-family;
19 src: url(data:application/font-woff;charset=utf-8;base64,BASE64_WOFF_FONT) format('woff'),
20 url(data:application/x-font-ttf;charset=utf-8;base64,BASE64_TTF_FONT) format('truetype');
25 // http://sass-lang.com/documentation/file.SASS_REFERENCE.html#maps
32 // NOTE: This is as complex as we want to get with SCSS functionality.
34 // Now that we have a map of icons above, we can iterate over that map and create an icon class
35 // for each icon in that list. The iterator below produces CSS classes like this:
38 // font-family: VideoJS;
39 // font-weight: normal;
40 // font-style: normal;
42 // .vjs-icon-play:before { content: "\25b6"; }
44 // We can then use @extend in the codebase when we need to add an icon to a class. @extend builds up
45 // the selectors for you so you can avoid duplication. This is generally a bad idea, but since each
46 // icon should only be extended one or two other places, we'll roll with it.
47 @each $name, $content in $icons {
49 font-family: $icon-font-family;
54 content: char($content);