Skip to content
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

Remove new Color("--foo" [, root]) syntax #160

Closed
LeaVerou opened this issue Jun 26, 2022 · 0 comments
Closed

Remove new Color("--foo" [, root]) syntax #160

LeaVerou opened this issue Jun 26, 2022 · 0 comments

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Jun 26, 2022

It's trivial for people to read the computed style and create a color object with a custom property's value. We should not be handling this for them as it's quite a divergence from our focus and it complicates the constructor.

For anyone looking for what to replace calls to new Color("--foo", root) with, it's just:

new Color(getComputedStyle(root).getPropertyValue("--foo"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant