Home

Awesome

tachyons-build-css Build Status js-standard-style

Transpile Tachyons PostCSS to vanilla CSS. This build process also removes comments, autoprefixes, and has options for minifying the output or repeating class selectors (to play nice with overly specific CSS frameworks).

Installation

npm install --save-dev tachyons-build-css

Usage

const fs = require('fs')
const tachyonsBuildCss = require('tachyons-build-css')

const input = fs.readFileSync('input.css', 'utf8')

tachyonsBuildCss(input, {
  from: 'input.css',
  to: 'output.css',
  minify: true,
  plugins: [my(), other(), plugins()]
}).then(result => {
  fs.writeFileSync('output.css', result.css)
})

If you want more control, but want the plugins used here, you can get them with the getPlugins function

const { getPlugins } = require('tachyons-build-css')

const plugins = getPlugins({
  from: 'input.css',
  to: 'output.css',
  minify: true
})

Options

OptionDefaultDescriptionValues
fromundefinedThe input file namefile name
toundefinedThe output file namefile name
minifyfalseMinify the output CSStrue, false
repeatfalseWhether to repeat classes in selectorsfalse, 1..10
pluginsfalseAdditional postcss plugins[my(), other(), plugins()]
atImport{}Options for postcss-importpostcss-import options

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander (@4lpine).


This package was initially generated with yeoman and the p generator.