Exposes Tachyons class names as properties
Branch: master
Clone or download
Pull request Compare This branch is 3 commits ahead of samjbmason:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
defaultRules.js
generate.js
index.js
license
package-lock.json
package.json
readme.md
tachyons.css
yarn.lock

readme.md

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