webfonts - Stylus ParseError: Generating Font Icons -
i'm trying use stylus generate font icons in icomoon, generate variables, i'm getting parseerror:
parseerror: icons.styl:930 926| icon, in $icons 927| .icon-{icon} 928| &:before 929| content ${icon}
unexpected "eos"
i generate :before , after content values corresponding classes. loop follows:
for icon, in $icons .icon-{icon} &:before content ${$icon} i first assign each icon content value so:
$icon-chrome = "\e829" $icon-firefox = "\e82a" $icon-ie = "\e82b" $icon-opera = "\e82c" $icon-safari = "\e82d" $icon-icomoon = "\e82e" where $icons equal to:
$icons = home2, home3, home4, office, newspaper, pencil2 how can fix parseerror correctly generate font icons?
you can't use interpolation dynamically generate variable name. purpose have lookup built-in function. example:
$icons = home2, home3 $icon-home2 = '\e829' $icon-home3 = '\e82a' icon, in $icons .icon-{icon} &:before content lookup('$icon-' + icon) but hashes better task.
Comments
Post a Comment