styled-fns

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
styled-fns
301.3.36 years ago6 years agoMinified + gzip package size for styled-fns in KB

Readme

styled-fns

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




!Build Statusbuild-badgebuild !Code Coveragecoverage-badgecoverage !versionversion-badgepackage !downloadsdownloads-badgenpmtrends !MIT Licenselicense-badgelicense
All Contributors !PRs Welcomeprs-badgeprs !Code of Conductcoc-badgecoc
!Watch on GitHubgithub-watch-badgegithub-watch !Star on GitHubgithub-star-badgegithub-star !Tweettwitter-badgetwitter

Table of Contents




Installation

This module is distributed via npmnpm which is bundled with nodenode 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 requestprs and add it here!

Contributors

Thanks goes to these people (emoji keyemojis):

|
Jianhua Cheng

💻 📖 🚇") ⚠️ | | :---: |

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

LICENSE

MIT