javivelasco / react-css-themr

Easy theming and composition for CSS Modules.
MIT License
591 stars 68 forks source link

Default theming example #70

Closed xli1000 closed 7 years ago

xli1000 commented 7 years ago

The README.md shows this example where a theme is passed in as a prop to override the default theme:

import style from './Section.css';
[...]
<SuccessButton theme={style.button}>Yai!</SuccessButton>

But this didn't work for me--since style is an object like { button: 'button-1jq92' }, style.button is a string and can't be used to override the default theme.

I had to do something like this:

<SuccessButton theme={ {button: style.button} }>Yai!</SuccessButton>

or just theme={style}.

Am I missing something, or is this a mistake in that example?

raveclassic commented 7 years ago

You are correct, it's a mistake in the docs. theme prop always accepts an object. Related: #31

xli1000 commented 7 years ago

I see that a PR has already been submitted to correct this: #69.