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
  • 245,468
  • 26
  • 309
  • 415
thewebtud
  • 455
  • 2
  • 4
  • 21

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
  • 144
  • 1
  • 6