4 ms·
The solution is not to codify best practices; the solution is to use a better language! (This coincides with PG's argument for lisp/macros) Although the slides
by hasenj 16y ago
The solution is not to codify best practices; the solution is to use a better language! (This coincides with PG's argument for lisp/macros)
Although the slides do mention sass an lesscss at the last side, I think 'stylus' is a much better css language.
http://learnboost.github.com/stylus http://learnboost.github.com/stylus
IT has powerful abstraction facilities in the form of functions and mixins.
Here's an example of how powerful it can be:
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
{prop} args
border-radius()
vendor('border-radius', arguments)
Having this abstraction, we can:
button
border-radius 1px 2px / 3px 4px
And the output will be:
button {
-webkit-border-radius: 1px 2px / 3px 4px;
-moz-border-radius: 1px 2px / 3px 4px;
border-radius: 1px 2px / 3px 4px;
}
- wvenable 16y agoA better language (that compiles to CSS) won't solve the problems presented in the slide. I have to admit, my CSS tends to get ugly over time simply because the cascading and specificity rules in CSS so are complicated. And sass and less don't change that, they just make it easier to repeat yourself when it is required.