BlueBase supports different types of theme customisation requirements so that a developer can do a single usage customisation or globally override a theme.
There may be use cases where you may need to keep specific values same, no matter which theme is selected, i.e. primary colours, etc.
To do this, use the theme.overrides
config. This change is global, and overrides all installed themes.
BlueBase ships with two built-in themes: BlueBase Light
& BlueBase Dark
. You can extend any of the two to create you own theme.
Using the ThemeProvider
overrides prop. This change is only for this tree.
Nesting themes
Overriding themes
It is possible to nest multiple themes in a single project. To theme a specific portion of your app, use the ThemeProvider
component.
In the example above, we pass the theme
prop to the ThemeProvider
component. This prop takes the key of the theme to use for children components. If this prop is not set, the globally selected theme is used.
The ThemeProvider
component can also be used to override a theme for a one time usage.