Kristiyan Kostadinov
Kristiyan Kostadinov

Reputation: 3712

Sass store selector in variable

I am trying to save a selector in SASS for easier referencing later, however I get a syntax error.

Here's what I'm trying to do:

$icon:  [class*="icon"];

Upvotes: 9

Views: 2681

Answers (1)

cimmanon
cimmanon

Reputation: 68319

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

$icon: '[class*="icon"]';

#{$icon} {
    // stuff
}

Upvotes: 11

Related Questions