Create data attribute selector on a SASS loop
Hey, I'm trying to create a selector that relies on a
data-theme
attribute, and in order to create a bunch of these selectors based on a list of colors I was trying to do something like this:
Unfortunately, the compiled CSS does not have the quotes around the value on that selector:
I tried to use SASS's string module but I still get the same result, even after trying several variations to interpolate the command or store the string in a separate variable. Then, even after hard-coding the value directly to see if it'd works, I still get the same result.
Currently I'm getting it to work by using a class instead of an attribute so I know the issue is here. Any thoughts? Thanks!2 Replies
Pfff, false alarm. I had the code under the wrong selector... how come that when you show some issue to someone it suddenly works or you realize the problem? 😄
😊😊