Thursday, November 17, 2011
Introducing Closure Stylesheets
By Michael Bolin, Open Source Engineer
Cross-posted from the Open Source at Google blog
(CSS is for programming, not for pasting.)
You see, the nature of CSS runs contrary to the DRY principle that is exhibited in good software engineering. For example, if there is a color that should be used for multiple classes in a stylesheet, a developer has no choice but to copy-and-paste it everywhere because CSS has no concept of variables. Similarly, if there is a value in a stylesheet that is derived from other values, there is no way to express that because CSS also lacks functions. Common patterns of style blocks are duplicated over and over because CSS has no macros. All of these properties of CSS conspire to make stylesheets extremely difficult to maintain.
Michael Bolin is an Open Source Engineer at Google.
Posted by Scott Knaster, Editor