I use CSS counters to create some variations of an ordered list <ol>
. I accomplish this by using different classes and tweak the styling of each class.
Now I want the counters to respond to screen size, that's smaller numbers on smaller screens. I have done this by using media queries and setting the size for each of the four classes separately. This works perfectly. However, this results in a lot of duplicated code. To minimise code, I've tried to target the four different classes simultaneously by:
ol.class1, ol.class2, ol.class3, ol.class4 {...}
I also tried:
ol > .class1, .class2, .class3, .class4 {...}
However, in each case I lost the responsive behaviour. So obviously, I'm doing it incorrectly. How can I target the different classes of the ordered list <ol>
simultaneously in order to style them together?