You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 years ago | |
|---|---|---|
| .. | ||
| dist | 3 years ago | |
| src | 3 years ago | |
| test | 3 years ago | |
| LICENSE.md | 3 years ago | |
| README.md | 3 years ago | |
| package.json | 3 years ago | |
README.md
@styled-system/variant
Read the docs: https://styled-system.com/variants
Usage
import styled from 'styled-components'
import variant from '@styled-system/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 theme-aware variant styles with user-defined shapeprop: (defaultvariant) custom prop name for variantscale: optional theme key for adding variants to the theme object
MIT License