-
Notifications
You must be signed in to change notification settings - Fork 609
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
feat: support custom accent colors, fix preset contrast issues #267
feat: support custom accent colors, fix preset contrast issues #267
Conversation
RNBW-3344 Support custom accent colors in built-in themes
This should be done after RNBW-3341. API concept:
(property names need some thought, but this is the idea of how it works mechanically) |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
lovely jubbly 👌 in the example, we have defined the custom accent color as: accentColor: 'yellow',
accentColorForeground: 'black', which renders like this: one thing that confused me a bit, is that in order to remove this confusion, what do we think about calling it |
@peduarte I'm using an inverted example in light mode, so that screenshot is actually using |
@markdalgleish ah ok, cool! |
The
accentColor
option on the built-in themes now accepts arbitrary strings rather than the name of a built-in preset.To allow consumers to adjust the text contrast, there is now also an
accentColorForeground
option.For example:
The built-in accent color presets are now available via an
accentColors
property on each theme function. For example:This PR also increases the foreground text contrast for some of the accent color presets used for the dark themes. Since our color palette is already quite soft, the accent colors below were picked by eyeballing them and subjectively deciding which ones were a little too low contrast against white text, but I'm happy to change this if there's disagreement. The main thing is that, either way, we now have a mechanism for easily changing this per accent color preset.
Before:
After:
This PR also removes the
yellow
preset since it can't be made consistently accessible across all themes, notably in the light theme:Closes RNBW-3344 and RNBW-3341.