Customise Components
Theming in BlueBase provides an elaborate mechanism to customise component styles. Following is a list of options to do this in a sequence of lowest to highest priority.
Component styles in all of the following methods can be thunks as well.
Through defaultStlyes
static prop
defaultStlyes
static propIn BlueBase it is possible to provide a defaultStyles
static property to a component. This is very similar to the defaultProps
concept of React.
Priority
In terms of priority, this method has the least priority, and these styles may be overwritten by any of the following methods.
Use When
Use this method to define the default styles of the component. These will represent a state of the component without any customisation.
Through Component Registry
It is also possible to save styles of a component in the ComponentRegistry.
When registering a new component
Overriding styles of an existing component.
Priority
In terms of priority, these styles override defaultStyles
but they can be overwritten by following methods.
Use When
Us this method when you want to define global styles of a component, but you also want other plugins to able to customise them.
Through theme
Through styles
prop
styles
propComponent Styles Structure
In BlueBase, ComponentStyles have the following structure:
This is very similar to React Native's StyleSheet.create API.
Example
Thunks
Describe best practices: root, hover, etc.
Last updated