- install node: https://nodejs.org/en/download
git clone git@github.com:nialloc9/nested-style-component-themes-poc.git
cd nested-style-component-themes-poc
npm install
npm start
- How does the styled-components library handle nestd themes?
-
Themes can be nested.
-
In the event the provider does not have a value specified in it's theme it will reach for the parent provider to see if it has a value specified. It will keep going up the tree until it finds a provider that has the value specified.
-
The nearest provider value will override their corresponding parent theme values.
-
If no value is found undefined will be used.