Is there a way to define a CSS class as being equal to another? For example if I had a class:
.myClass{
background-color: blue;
}
is there a way to define a second class as having the same style as myClass without just copying and pasting?
EDIT:
Sorry, let me be a bit more clear. Is it possible to do this after declaring the first class, possibly even in another stylesheet?
Yes, like this:
.myClass,
.mySecondClass,
.myThirdClass {
background-color: blue;
}
EDIT:
Based on your edit: What you might be looking for, if this is something you really want to do is to look into SASS which basically is like css but with variables and stuffs. But vanilla CSS doesn't have any native support for what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With