|
|
|
|
|
by nickand
5328 days ago
|
|
Redundant functionality to JavaScript is redundant. That being said I'm all for designers having baby steps they can use to simulate some of the functionality of JavaScript. After all the days of the one line of JavaScript that does that cool effect are over now that you aren't cool if you don't use prototypes and 'modules.' JavaScript is getting to the point where if you don't use at least 3 libraries to make your onclick event handler you get publicly lambast. Also who says you need to copy the color every time you use it? This is how it works. If you have one important property that you want to change everywhere then you use the most specific target class necessary for each of those classes in a comma separated list attached to only that property then you can change them all later or add new classes to them. .class, .anotherClass, .yetSomeOther .moreSpecificTarget {color:blue;} Also if you want to simulate if / then statements then you write your most general classes first followed by your more specific classes. So: .blue {color:blue;} .blue.darker {color:rgb(4,4,179)}; It's even better than a conditional. It's a switch. |
|
CSS won't let you do any of this natively.