0

i have few dynamic classes dynamicClass1,dynamicClass2,dynamicClass3, ... ,dynamicClassN

I want to apply a common css property to all of them in my .scss file.

Approach I followed -

dynamicClass {
  &* {
        display: grid;
  }
}

This isn't working. What's the correct way to do this?

Temani Afif
  • 211,628
  • 17
  • 234
  • 311
thewebtud
  • 308
  • 3
  • 15

1 Answers1

0

I think you would need to do something like this:

[class^="dynamicClass"], [class*=" dynamicClass"] {
  display: grid;
}

Based on this answer: Is there a CSS selector by class prefix?

LeoSanchez
  • 134
  • 1
  • 6