css-variables-polyfill
css-variables-polyfill copied to clipboard
A basic polyfill for CSS Variables/custom-properties
Hello, I faced a problem in a project where one was my variables was assigned as another one (e.g. --var1: var(--var2);). I managed to solve it by modifying replaceGetters like...
https://github.com/aaronbarker/css-variables-polyfill/blob/c27cb7e2a839e52833c399a0873b3c032a72146c/css-var-polyfill.js#L66 I suggest changing to something like this: `theCSS.match(/(--[\w-]+:.+);/g)` Otherwise, rules on the same line as the CSS variable are included in the match, and IE 11 throws exceptions. From...
Found this identified here https://gist.github.com/stramel/91d05253f801f771da38b3bc7d3c765f#gistcomment-2258818 The suggestion of using `document.styleSheets` will take some work to implement, if it is even practical. Parsing the full document vs parsing individual statements may...