d3dc / classier-react

Use stylesheets for styles, not Javascript
ISC License
1 stars 0 forks source link

Add object notation for variants #6

Closed d3dc closed 6 years ago

d3dc commented 6 years ago

This PR adds support for tailwind variants by allowing objects in cx prop values.

<Box w={[ 'full', { md: '4/5', lg: '3/5' } ]} />

The key names of any object are prefixed to the prop name and the object values are appended following the same rules as every other normal value.

w-full md:w-4/5 lg:w-3/5

Things to consider:

d3dc commented 6 years ago

Trying to publish this under the next tag... 🤞

npm install classier-react@next
d3dc commented 6 years ago

Merging as the simple-blocks branch will allow transformFn to be changed.

note nested variants are not defined behavior