keyrune/src/scss/_helpers.scss

28 lines
668 B
SCSS

//
// output the correct glyphs for the 3 layers' pseudoelements
@mixin layers($layers) {
&::before {
content: glyph-content(map-get($layers, rarity));
}
&.#{$keyrune-prefix}-border {
&::after {
content: glyph-content(map-get($layers, border));
}
}
&.#{$keyrune-prefix}-inner {
&::marker {
content: glyph-content(map-get($layers, inner));
}
}
}
// return the css variable for the glyph's aspect ratio
@mixin ratio($ratio) {
--aspect-ratio: #{$ratio};
}
// correctly parse the glyph's unicode for css
@function glyph_content($glyph) {
@return unquote("\"#{$glyph}\"");
}