Skip to content

Instantly share code, notes, and snippets.

View fiximportant's full-sized avatar

igor fiximportant

View GitHub Profile
@fiximportant
fiximportant / css-var-polyfill.js
Created December 6, 2017 15:56
CSS Variable Polyfill
/*
TODO:
- Option to wait to apply anything until all <link>s are parsed or inject what we have and update as each <link> returns
*/
var cssVarPoly = {
init: function() {
if (window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)')) {
return;
}
cssVarPoly.ratifiedVars = {};