How to make a color name not automatically convert to a hex value in Stylus? -


i iterating loop stylus preprocessor. need color class names , color values , hex values fine class names not ideal.

$colors = red blue green orange; item in $colors {     .{"" + item} {         color: item;     } } 

and compiled:

.#f00 {   color: #f00; } .#00f {   color: #00f; } .#008000 {   color: #008000; } .#ffa500 {   color: #ffa500; } 

but expected result was:

.red {    color: #f00; // or red } .blue {     color: #00f // or blue } // .. etc 

i can imagine there function names remain.

any appreciated.

if can convert original list of colors set of strings,

$colors = 'red' 'blue' 'green' 'orange'; item in $colors {     .{item} {         color: convert(item);     } } 

yields

.red {   color: #f00; } .blue {   color: #00f; } .green {   color: #008000; } .orange {   color: #ffa500; } 

if change convert unquote, hex values replaced names supply them in list.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -