@rhizo/variant
v1.0.12
Published
Downloads
13
Readme
@rhizo/variant
Usage
import styled from 'styled-components'
import variant from '@rhizo/variant'
const Button = styled('button')(
variant({
variants: {
primary: {
color: 'white',
bg: 'primary',
':hover': {
bg: 'black',
}
},
secondary: {
color: 'white',
bg: 'secondary',
':hover': {
bg: 'black',
}
},
}
})
)
// <Button variant='primary' />
// <Button variant='secondary' />
Options
variants
: object of seed-aware variant styles with user-defined shapeprop
: (defaultvariant
) custom prop name for variantscale
: optional seed key for adding variants to the seed object
MIT License