Skip to content

A collection of utility functions to use with `styled-components`, make writing component with SC more fascinating.

License

Notifications You must be signed in to change notification settings

chengjianhua/styled-fns

Repository files navigation

styled-fns

A collection of utility functions to use with `styled-components`, make writing component with SC more fascinating.


Build Status Code Coverage version downloads MIT License

All Contributors PRs Welcome Code of Conduct

Watch on GitHub Star on GitHub Tweet

Table of Contents

Installation

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

Usage

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.

API

See details in API Documentation.

Inspiration

A few utilities are inspired by other fascinating libraries:

And the idea of creating this library is inspired by react-fns, we have the similar name obviously 🤷‍.

More features

I'm not aware of any, if you are please make a pull request and add it here!

Contributors

Thanks goes to these people (emoji key):


Jianhua Cheng

💻 📖 🚇 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT

About

A collection of utility functions to use with `styled-components`, make writing component with SC more fascinating.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published