A collection of utility functions to use with `styled-components`, make writing component with SC more fascinating.
This module is distributed via npm which is bundled with node and
should be installed as one of your project's dependencies
:
npm install --save styled-fns
import {variants} from 'styled-fns'
const getColor = variants({
primary: 'blue',
secondary: 'violet',
danger: 'red',
})
This library is shipped as an ESM bundle, importing only the function you need could help reduce the size of your bundle.
See details in API Documentation.
A few utilities are inspired by other fascinating libraries:
variants
is inspired by styled-theming.
And the idea of creating this library is inspired by react-fns, we have the similar name obviously 🤷.
I'm not aware of any, if you are please make a pull request and add it here!
Thanks goes to these people (emoji key):
Jianhua Cheng 💻 📖 🚇 |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT