0.1.0 • Published 7 years ago

tachyons-as-props v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

tachyons-as-props

Exposes Tachyons class names as properties

Can be used with solutions like styled-jsx (that allows you to write css-in-js as a string) to access all of tachyons as properties on a npm module.

Install

$ npm install --save tachyons-as-props

Usage

The export is an object with the class names mapped as object properties, one thing to note is that all classnames are converted to camelCase and dashes are removed.

e.g

  • near-black becomes nearBlack
  • bg-washed-green becomes bgWashedGreen
import tachyons from 'tachyons-as-props'

const SomeReactComponent = () => (
  <div className="red-box">

  <style jsx>{`
    .red-box {
      ${tachyons.w3}
      ${tachyons.red}
      ${tachyons.h3}
    }
  `}</style>
  </div>
)

Related & inspiration

License

MIT Sam Mason