Beta showing the new API (as, merge, variants, with)
Pre-release
Pre-release
secretlifeof
released this
20 Aug 09:32
·
99 commits
to master
since this release
This beta release adds the new API. This is moving towards the final API.
import { Box, Text } from 'juhuui'
const BlueBox = Box.with({ bg: 'blue' });
const GreenText = Text.as('div').with({ color: 'green' });
const Merged = Box.merge([GreenText, BlueBox])
.as('main')
.variants({
sizes: {
sm: {
h: '200px',
w: '100px'
},
md: {
h: '400px',
w: '200px'
}
}
})
.with({ border: '1px solid orange' });
<Merged sizes="sm">Let's walk, talk and dance together</Merged>;