|
|
|
|
|
by toolate
5601 days ago
|
|
If this is object oriented then his approach can best be likened to multiple inheritance. Because CSS doesn't offer any kind of native inheritence he's forced to redefine each and every class for each instance. This is the equivalent of defining code like: var foo = new Animal Brown Quadruped Barking();
Even if styles could be inherited, this seems to be taking the wrong approach. Most of use realise that classes should be used to denote identity, and not behaviour (or in this case, styling). CSS preprocessors seem to fix the same problem in a much nicer way. /* Define classes used in HTML */
.sidebar {
@include bordered-box;
}
#special-offer {
@include bordered-box;
position: absolute;
top: 0;
right: 0;
}
/* Define theme information */
@mixin bordered-box {
h3 {
background: red;
color: white;
}
border: 1px solid red;
}
|
|
At least there's Less. Anyone use it, or know of a better system?