Skip to content

Instantly share code, notes, and snippets.

@fabiofidanza
Created May 27, 2016 16:10
Show Gist options
  • Save fabiofidanza/470f5a89c00004fd787e98ff5db9a59a to your computer and use it in GitHub Desktop.
Save fabiofidanza/470f5a89c00004fd787e98ff5db9a59a to your computer and use it in GitHub Desktop.
Sass unicode interpolation
$termsIcons: (
1 : ('e91c','e91d'),
2 : ('e919','e918'),
3 : ('e91e','e91f'),
4 : ('e91a','e91b'),
);
.page-taxonomy-term {
.title-container {
&:before, &:after {
@include iconFont;
position: absolute;
bottom: 0;
right: 0;
font-size: 200px;
color: $white;
}
&:after {
color: $secondaryColor;
}
}
}
@each $termId, $contents in $termsIcons {
$before: nth($contents, 1);
$after: nth($contents, 2);
.page-taxonomy-term-#{$termId} .title-container {
&:before {
content: unquote("\"")+unquote(str-insert($before, "\\", 1))+unquote("\"");
}
&:after {
content: unquote("\"")+unquote(str-insert($after, "\\", 1))+unquote("\"");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment