Skip to content

Overriding default button colors #1106

Answered by isTravis
WebDevTmas asked this question in Q&A
Discussion options

You must be logged in to vote

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 the getButtonAppearance function that defaultTheme relies on. I split things like this into separate files for each function that needs to be reproduced:

/* getButtonClassName.ts */

/* Copied from https://github.com/segmentio/evergreen/blob/master/src/theme/src/default-theme/component-specific/getButtonClassName.js */
/* Orignal va…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@WebDevTmas
Comment options

Answer selected by WebDevTmas
Comment options

You must be logged in to vote
6 replies
@brandongregoryscott
Comment options

@NikxDa
Comment options

@brandongregoryscott
Comment options

@NikxDa
Comment options

@brandongregoryscott
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
theming Question, feedback, etc. around theming architecture
5 participants