1.0.0 • Published 5 years ago

sunlight-theme v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

sunlight-theme

Demo

https://optimistic-kalam-56c21b.netlify.com

Usage

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>
  )
}