CSS variables are something I’ve been looking into for one of my new CSS projects. While researching I managed to dig up some interesting information (well, I thought it was) that I thought I’d share with you all.
There’s actually a draft proposal for a CSS Variables spec written by Dan Glazman (W3C CSS WG chair) and David Hyatt (Apple) that was published in 2008.
Apparently, this spec was implemented in webkit but was not enabled in the versions used in Safari or Chrome. Unfortunately, it looks like CSS variables were completely removed from webkit last month – hopefully this isn’t the end of them!
Personally, I like the idea of pre-defining data in CSS but I believe the term “variables” is incorrect. I think “constants” better describes their purpose since their contents cannot be programmatically modified once declared (using something like JavaScript)
CSS variables are something I’ve been looking into for one of my new CSS projects. While researching I managed to dig up some interesting information (well, I thought it was) that I thought I’d share with you all.
There’s actually a draft proposal for a CSS Variables spec written by Dan Glazman (W3C CSS WG chair) and David Hyatt (Apple) that was published in 2008.
Apparently, this spec was implemented in webkit but was not enabled in the versions used in Safari or Chrome. Unfortunately, it looks like CSS variables were completely removed from webkit last month – hopefully this isn’t the end of them!
I also found an essay from a W3C WG memeber that highlights some of the negatives of CSS varaibles: Why ‘variables’ in CSS are harmful.
Personally, I like the idea of pre-defining data in CSS but I believe the term “variables” is incorrect. I think “constants” better describes their purpose since their contents cannot be programmatically modified once declared (using something like JavaScript)