Closed stam closed 7 years ago
The only thing I don't like is that it is specific to primaryColor
. There are a lot more colors that might need overriding. However I guess this is a good first step.
getTheme however is executed quite often when clicking through storybook, but I was unsure if this needed fixing in re-cy-cle or was just inherent to how storybook works.
Yes normally it isn't called often.
There currently are a lot of component which use the primaryColor. This can however look quite monotone, so you might want to have some components deviate from the primaryColor.
I think the best place to define such a deviation is in the ReCyCleTheme.
In the current implementation: users can specify a primaryButtonColor. If it is not specified, it will fallback to the theme's primaryColor.
In this PR, this fallback is handled in
ReCyCleTheme.getTheme
, where a fallback object is created based onconfig.overridablePrimaryColors
. We cannot simply set these defaults inconfig.defaultConfig
as the values need to fall back to the primaryColor provided in the ReCyCleTheme theme props.getTheme
however is executed quite often when clicking through storybook, but I was unsure if this needed fixing in re-cy-cle or was just inherent to how storybook works.