Overriding default button colors #1106
-
I seem to be unable to override a primary buttons color.
Is this not based on the intent color? (spinner override works perfectly) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I've found a lot of the theming work is undocumented and fairly complex. You can't simply inspect the
And then I use that function in place of the default when updating my defaultTheme:
The spinner seems to be a simpler case that works in a straightforward way, while things like buttons, forms, radio buttons, etc are not. Would love an update from Evergreen folks on what the roadmap for clearer theming support or documentation looks like! |
Beta Was this translation helpful? Give feedback.
-
Hey there! Sorry for the relative silence here - the team's been quite busy with projects internally, so we haven't had a chance to engage here as frequently as we'd like. For theming in v5, @isTravis is spot on. It's a bit convoluted right now, but the way to get theming to work - for Buttons, or any of the other On the roadmap for v6 (which should be coming out in the next couple of months) include end-to-end theming support that's super flexible and straightforward. We're still hardening out the API and need to do things like doc-writing, etc for it - but it should solve the vast majority of use cases where theming's needed. |
Beta Was this translation helpful? Give feedback.
I've found a lot of the theming work is undocumented and fairly complex. You can't simply inspect the
defaultTheme
object and overwrite values because the real theme is derived from a set of functions and certain values are provided on that object (e.g. button colors) for convenience rather than canonical reference. To get overrides to work, I had to duplicate thegetButtonAppearance
function thatdefaultTheme
relies on. I split things like this into separate files for each function that needs to be reproduced: