-
Notifications
You must be signed in to change notification settings - Fork 100
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
Allow *Color to accept css variables, not only hex-colors #69
Comments
Same here, I only use variable to customize my components color, I would really like this feature. |
UP! I would also like this feature. |
As long as your variable is a hex value, you can pull the value from JS. window
.getComputedStyle(document.documentElement)
.getPropertyValue('--switch-on-color')
.trim() |
As @sec0ndhand mentioned you could extract the hex values from the CSS variables and then input them as props. The question is whether this should be done inside the library for convenience sake and I'm leaning towards no. A couple of problems come to mind:
|
Allow offColor, onColor, offHandleColor and onHandleColor to accept css variables, not only hex-colors.
In our project we use css vars to handle themes and we use them to customize components. But react-switch component doesn't allow to do this.
I would like to use switch component like this:
The text was updated successfully, but these errors were encountered: