Skip to content

Easily access theme props in styled-components

License

Notifications You must be signed in to change notification settings

elcoosp/themmer

Repository files navigation

Themmer

Greenkeeper badge Build Status style: styled-components

Easily access theme prop in styled-components

Install

npm i -S themmer

Why

// Quite ugly theme accessing
const UglyComponent = styled.div`
  background-color: ${props => props.theme.color.main.light};
  color: ${props => props.theme.color.main.dark};
`

What

import tm from 'themmer'
// Less ugly theme accessing
const LessUglyComponent = styled.div`
  background-color: ${tm`color.main.light`};
  color: ${tm`color.main.dark`};
`

About

Easily access theme props in styled-components

Resources

License

Stars

Watchers

Forks

Packages

No packages published