tachyons-for-js

Tachyons for CSS-in-JS


Keywords
css, tachyons, css-in-js, atomic css, functional css, design, responsive, performance, atomic-css, functional-css, tachyons-css
License
MIT
Install
npm install tachyons-for-js@0.3.3

Documentation

Tachyons-For-JS

Tachyons for various CSS-in-JS solutions.

There few Tachyons modules, that's difficult to include in this library. I'm still working on proper solution for those.

Those modules are:

  • debug.css
  • images.css
  • nested.css
  • skins-psuedo.css

v0.3.0 Breaking API change

Object properties chaining API is now replaced with functional API for speed. Now we export a function that accepts a string of tachyons classes and returns an Object with styles for those classes.

Important note: we use snake_case instead of kebab-case. In future releases you will be able to use both cases.

Like: w_100 instead of w-100, b__black instead of b--black.

...tc('ma0 pa0 ttu')

/**
 {
   margin: 0,
   padding: 0,
   textTransform: 'uppercase'
 }
*/

Quick Example (Fela.js)

import tc from 'tachyons-for-js'
import { createComponent } from 'react-fela'

const style = () => ({
  ...tc('ma0 pa0 ttu')
})

export default createComponent(style)

TODO

  • Add missing tachyons modules

    • border-colors.css
    • border-style.css
    • border-widths.css
    • debug-children.css
    • debug-grid.css
    • debug.css
    • hovers.css
    • images.css
    • skins.css
    • skins-psuedo.css
  • Add documentation

  • Add examples for different CSS-in-JS solutions

    • fela.js
    • csx
    • styled-components
    • css modules
    • styled-jsx
    • glamourous
    • ...any other css-in-js engine out there
  • Add the ability to import individual modules only

  • Make it possible to chain modules

  • Add utils module to provide various helpers