sass - SCSS mixin with argument interpolation is not working -


this question has answer here:

i'm creating mixin generate css background gradient, per ultimate css gradient generator.

the mixin looks this:

@mixin gradient-2-colors($color-1, $color-1-pos, $color-2, $color-2-pos) {   background: -moz-linear-gradient(top, $color-1 $color-1-pos, $color-2 $color-2-pos);   ... [other browser-specific entries]...   filter: progid:dximagetransform.microsoft.gradient(startcolorstr='$color-1', endcolorstr=\'$color-2\',gradienttype=0 ); } 

and last entry giving me trouble, since $color-1 in startcolorstr='$color-1' not being parsed variable! how can escape component of mixin make variable work inside of quotes?

use interpolation:

filter: progid:dximagetransform.microsoft.gradient(startcolorstr='#{$color-1}', endcolorstr=\'#{$color-2}\',gradienttype=0 ); 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -