0

Imagine I have 2 classes: class1 and class2. Now I want to apply styles on these classes depending on whether these classes have some attribute or not.

Here is my code :

.class1[someattribute] {
   /*styles*/
}

.class2[someattribute] {
   /*styles*/
}

But if I have 10 classes I should use [someattribute] 10 times. Is it somehow possible to put all this class1 and class2 style inside some kind of if block? like this:

[someattribute] {
      .class1 {
          /*styles*/
      }

      .class2 {
         /*styles*/
      }
}
mplungjan
  • 155,085
  • 27
  • 166
  • 222
O. Shekriladze
  • 1,103
  • 12
  • 32

0 Answers0