CSS pre-processors like Sass and LESS extend CSS in many useful ways, not least by allowing you to use variables in your code either as single values or blocks of multiple property/value pairs, called Mixins. So useful are these that developer Tab Atkins proposed to the W3C that they be adopted into CSS itself, but they were rejected as no suitable use cases were seen.
I think I’ve found a scenario in which, while the use of Mixins aren’t vital, they’re certainly very useful, and it’s because of one of the core principles of coding: DRY (Don’t Repeat Yourself).
Read the full article
I mentioned CSS Variables previously, and now the proposal has been published and I agree with authors Daniel Glazman and David Hyatt when they say:
We expect CSS Variables to receive a very positive feedback from both the Web authors’ community and browser vendors.
The syntax will be to declare the variables using the @variables at-rule, then calling them with the var() function:
@variables { keyColor: #f00; }
h1 { color: var(keyColor); }
That’s it. Beautifully simple, and I really, really look forward to seeing it implemented.
The W3C came under a lot of heavy flak last year for being slow, cumbersome, bureaucratic, etc; there were calls for a CSS2.2 (which I seconded) which rounded up all the existing implemented features, and for the CSS Working Group to be disbanded — a lighter, alternative task force, the CSS Eleven, was set up to try and make sense of it all. But as we’ve heard nothing from them in the six months since they were set up, I think the Eleven have found it’s not as easy as it looks.
The CSS WG has a new chair now, including the passionate Daniel Glazman, and it seems to be refocused and refreshed, which is good news; in his latest blog post, he says that the WG is aiming for RECs, RECs, RECs
. If that’s the case, maybe we can start to get excited.
Read the full article