Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

SCSS - Attribute selector value gets quoted

$
0
0

Here's the SCSS:

@mixin bg($i) {
   /*...*/
}

select {
    $i: 0;
    @while $i <= 10 {
        &[value="#{$i}"] ~ .container {
            background-image: bg($i);
        }
        $i: $i + 2;
    }
}

where bg($i) refers to a function that spits out a URL based on input.

This outputs:

select[value="0"] ~ .container { /*...*/ }
//...

However, this selector doesn't work. I need it to output like this:

select[value=0] ~ .container {/*...*/}
//...

Note that doing something like this:

[value=$i]

results in a compiler error. ("Error: Expected identifier" at $i)

Is there a way to force SCSS to unquote my number value?


Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>