tachyons-as-props

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i tachyons-as-props

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • samjbmason