1.1.0 • Published 8 years ago

tachyons-build-optimal-css v1.1.0

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

tachyons-build-optimal-css

Transpile Tachyons PostCSS to vanilla CSS, optionally supply a whitelist for optimal CSS output.

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-optimal-css

Usage

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

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

build(input, {
  from: 'input.css',
  to: 'output.css',
  minify: false,
  whitelist: ['w4', 'w2', 'mw4'],
  stripComments: true
}).then(result => {
  fs.writeFileSync('output.css', result.css)
})

Options

OptionDefaultDescriptionValues
fromundefinedThe input file namefile name
toundefinedThe output file namefile name
minifyfalseMinify the output CSS, infers stripCommentstrue, false
repeatfalseWhether to repeat classes in selectors1..10
whitelist[]Restrict output CSS to whitelisttachyons classes
stripCommentsfalsestrip commentstrue, false

License

MIT