Re:CSS Variables in Firefox Nightly
by georgecalm on Sunday December 15, 2013 @11:00AM
(#6909779)
Does anyone know if there's a polyfill for CSS variables out there? Possibly a library that creates plain old CSS out of the one that uses variables. It would be useful until this is rolled out to other browsers.
[ Parent
| on HN ]
Re:CSS Variables in Firefox Nightly
by andreypopp on Sunday December 15, 2013 @02:17PM
(#6910437)
There's rework-vars[1] for rework[2] which provides CSS style variables but w/o inheritance so it's not a polyfill technically.
[1]: https://github.com/visionmedia/rework-vars [2]: https://github.com/visionmedia/rework
You cannot build a polyfill with full feature-parity with the sole CSS. How do you manage the following one:
a:link { color: var(main-color); }
.important-quote { var-main-color: red; }
/* <div class="important-quote"> <a href="#">Hi, I should be red;</a> </div> */
Mh.. Well you could actually do some kind of @extend-on-steroids, if you do not care to bloat your styles.Is this the final variable spec?, creating a simple processor should not be too complicated,the issue would be on the javascript side,since it seems these vars are accessible from javascript.