yarn
yarn storybook
const themes = {
vanilla: {
colors: {
brand: '#F3E5AB'
},
variants: {
italic: {
fontStyle: 'italic'
}
}
},
pistachio: {
colors: {
brand: '#93C572'
}
}
}
const ThemeAwareComponent = styled(Element)`
color: ${getColor('brand')}
`;
const ThemedApp = () => (
<ThemeContextProvider themes={themes}>
<ThemeProvider name="vanilla">
<ThemeAwareComponent>vanilla</ThemeAwareComponent>
<ThemeProvider name="pistachio">
<ThemeAwareComponent variant="italic">pistachio</ThemeAwareComponent>
</ThemeProvider>
</ThemeProvider>
</ThemeContextProvider>
);
- using tokens as values in themes
- export token selectors
Dual CC0 and MIT.