News for hackers. Stuff that matters.
Re:CSS Variables landing in Chrome 49 by mendelk on Sunday February 07, 2016 @02:12PM (#11054257)
For those commenting about SASS having this forever etc, note that this goes a step further:

    :root { --color: blue; }
    div { --color: green; }
    #alert { --color: red; }
    * { color: var(--color); }
You can't accomplish that with SASS today. More info [0].

In fact, this feature isn't even covered with cssnext:

    The current transformation for custom properties aims to provide a future-proof way of using a limited subset (to top-level :root selector) ... [1]
I'm very curious whether or not this paradigm will be accepted as "best practice", or how it will be used.

[0] https://developers.google.com/web/updates/2016/02/css-variab...

[1] http://cssnext.io/features/#custom-properties-var

Re:CSS Variables landing in Chrome 49 by wanda on Sunday February 07, 2016 @02:34PM (#11054382)
Don't forget that CSS Variables can also be used within media queries.
Re:CSS Variables landing in Chrome 49 by masklinn on Sunday February 07, 2016 @02:43PM (#11054431)
And if you change a CSS variable in JS, it will recompute all of its uses.
Re:CSS Variables landing in Chrome 49 by madeofpalk on Sunday February 07, 2016 @09:53PM (#11056140)
If you're interested in seeing what happens next with CSS Variables, check out the CSS Houdini project https://drafts.css-houdini.org

It starts with a JS API for more control over CSS Variables (which are actually called Custom Properties), and then goes into APIs for custom renders and even custom layout engines, all controlled via JS + Web Workers

Re:CSS Variables landing in Chrome 49 by cdata on Monday February 08, 2016 @12:16AM (#11056466)
Also on the topic of things SASS cannot do:

Custom Properties effectively enable "styling APIs" to be declared for Custom Elements that have a shadow root, since Custom Properties cascade across shadow boundaries (detail in parent's [0]).