diff options
-rw-r--r-- | readme.md | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -2,6 +2,36 @@ ## Demo +[https://optimistic-kalam-56c21b.netlify.com](https://optimistic-kalam-56c21b.netlify.com) + ## Usage -## Bugs +```javascript +const containerStyle = ({ colours }) => css` + color: ${colours.main}; +` + +const mainRange = colormap({ + colormap: 'autumn', + nshades: 11, + format: 'hex', + alpha: 1 +}) + +const colourMiddleware = theme => { + return { + ...theme, + colours: { + main: mainRange[theme.lightLevel] + } + } +} + +export const DemoComponent = ({ children }) => { + return ( + <SunlightTheme middleware={[colourMiddleware]}> + <div css={containerStyle}>{children}</div> + </SunlightTheme> + ) +} +``` |