styled-component-variant
A tiny helper to enable you to vary your React components styles based on a prop value.
npm i styled-component-variant
Usage:
import variant from 'styled-component-variant'; const primary = css` background-color: 'blue';`; const secondary = css` background-color: 'orange';`; // you can use the theme property in your stylesconst tertiary = theme css` margin: ;`; const use = ; const MyButton = use; // render a blue button<MyButton ="primary">Click me</MyButton> // render an orange button<MyButton ="secondary">Click me</MyButton>