styled-components-theme icon indicating copy to clipboard operation
styled-components-theme copied to clipboard

Added nested colors in theme.

Open lewisacidic opened this issue 7 years ago • 0 comments

Now have nested colors in theme. For example:

// theme passed to ThemeProvider
const theme = {
  ui: {
    color: '#424242'
  }
}

// Button can be styled as below:
const Button = styled.button`
  color: ${theme.ui.color};
  &:hover {
    color: ${theme.ui.color.darken(0.1)};
  }
`

I'm pretty new to JS and moved the code around a bit, so feel free to edit/close without merging.

lewisacidic avatar May 02 '18 18:05 lewisacidic