jsdom / cssstyle

A Node.js implementation of the CSS Object Model CSSStyleDeclaration interface
MIT License
107 stars 70 forks source link

allow var functions in style.color values #125

Open ddemolina opened 3 years ago

ddemolina commented 3 years ago

Hi,

I've seen that when I try to insert a value to style.color a function called parseColor not allow to use values with var function like var(--customVar).

One solution is add another regEx in parser.valueType to return a color type but maybe there is a more transversal solution wich is being implementig to support this kind of values in all properties.

Thank you for your help

filipkis commented 3 months ago

This is indeed a big issue as vars are becoming more common in modern CSS. Please let's address it quickly, there is already a PR that fixes it linked above.

This would also address the second part of the #89