-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colors are not interpreted correctly #48
Comments
SidneyNemzer
changed the title
Colors are not correctly interpreted
Colors are not interpreted correctly
Jan 26, 2017
This is causing an issue with JSDOM. |
... and all its dependencies, as JEST, REACT-TESTING-LIBRARY etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Keywords
CSS has hundreds of color keywords, but CSSStyle only recognizes a few
https://github.com/chad3814/CSSStyleDeclaration/blob/master/lib/parsers.js#L100-L116
HSL and HSLA
CSSStyle has no logic to interpret HSL or HSLA values. Here's the regex for Hex, RGA, and RGBA. HSL and HSLA are missing.
https://github.com/chad3814/CSSStyleDeclaration/blob/master/lib/parsers.js#L28-L30
Computing the result
Hex values are correctly converted to RGB, however keywords (even valid ones) are not. If CSSStyle intends to emulate a browser's behavior, it should convert everything to RGB or RGBA
TLDR
CSSStyle doesn't handle color values correctly
The text was updated successfully, but these errors were encountered: