-
Notifications
You must be signed in to change notification settings - Fork 3
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
Color management/generation and themes #26
Comments
I guess that the implementation of themes could also affect this value. Is there any way to dynamically calculate this contrast ratio as well? |
I know they have had issues specc’ing this in CSS as it’s a pretty popular issue but that means lots of options exist in JS/TS-land. Even React actually – with an explainer in the ReadMe. I guess the main challenge may be building upon the known solutions to find the nearest match with good enough contrast in a dynamic manner, and reliably. But in theory it should be feasible. |
Took a deeper look at MUI, which has some world-class and extensive color manipulation utility to achieve some accessibility in their theming.
|
have you looked into https://www.radix-ui.com/colors ? |
@danielweck Not yet but thanks for the reminder as I’ve been looking into Libraries and how they manage theming in general 🙏 |
For reference, how colors are generated in Radix. Couldn’t take an extensive look yet though, so can’t describe what is happening, I’m just logging the URL so that I remember. |
Rename the issue given the scope has changed, and will not be limited to immersive mode (and its In the future we may want to provide with automatic generation of palettes, etc. But also helpers that can be used when creating a theme, as can be seen in MUI for instance. |
After extending themes properties in the Playground preferences, I guess a sensible first implementation could be to create tonal palettes from main colors e.g. In that case it could either be automatic when a theme property is That said, I’d be happy to hear how others would approach this issue. |
Right now our primary color is #4d4d4d. To have a contrast that passes WCAG AA for graphical objects and UI Components, it needs to be at least
60%
opacity, which makes the difference between normal and immersive modes kinda difficult to notice.The text was updated successfully, but these errors were encountered: