I have this variable:
$gutter: 10;
I want to use it in a selector like so SCSS:
.grid+$gutter {
background: red;
}
so the output becomes CSS:
.grid10 {
background: red;
}
But this doesn't work. Is it possible?
I have this variable:
$gutter: 10;
I want to use it in a selector like so SCSS:
.grid+$gutter {
background: red;
}
so the output becomes CSS:
.grid10 {
background: red;
}
But this doesn't work. Is it possible?
From the Sass Reference on "Interpolation":
Furthermore, the
@each
directive is not needed to make interpolation work, and as your$gutter
only contains one value, there's no need for a loop.If you had multiple values to create rules for, you could then use a Sass list and
@each
:...to generate the following output:
Here are some more examples..
If used in a string for example in a url:
if it would be a vendor prefix, in my case the mixin did not compile. So I used this example
Here is the solution