In my CSS, I have something like this:
.classA .class1,
.classA .class2,
.classA .class3 a:hover,
.classA .class4,
.classA #id1,
.classA .class5
{ color: white;}
.classA .class1,
.classA .class6
{ background-color: red;}
etc...
Since I am repeating .classA
so much, I wondered if there is a more efficient way to write this?
My use case:
I'm styling different pages with similar elements but with different color schemes. So rather than .classA I'm adding a class of .Orange to one page and say, .Green to another, .Blue to a third.
Then I'm applying orange and green and blue styling respectively to the elements on those pages.
.Orange .btn,
.Orange .accordion-heading,
.Orange .promo-box {color: orange; background: white;}
.Orange h2 {color: orange;}
.Green .btn,
.Green .accordion-heading,
.Green .promo-box {color: green; background: white;}
.Green h2 {color: green;}