Sass store selector in variable

I try to save the selector in SASS for a simpler reference later, however I get a syntax error.

Here is what I am trying to do:

$icon: [class*="icon"]; 
+6
source share
1 answer

You need to convert it to a string if you want to use it as a variable:

 $icon: '[class*="icon"]'; #{$icon} { // stuff } 
+7
source

Source: https://habr.com/ru/post/951209/


All Articles