styled-fns

1.3.3 • Public • Published

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

Package Sidebar

Install

npm i styled-fns

Weekly Downloads

7

Version

1.3.3

License

MIT

Unpacked Size

42.1 kB

Total Files

15

Last publish

Collaborators

  • chengjianhua