1.0.12 • Published 2 years ago

@rhizo/variant v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@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 shape
  • prop: (default variant) custom prop name for variant
  • scale: optional seed key for adding variants to the seed object

MIT License

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago