Skip to content

davidmarkclements/tachyons-build-optimal-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Option Default Description Values
from undefined The input file name file name
to undefined The output file name file name
minify false Minify the output CSS, infers stripComments true, false
repeat false Whether to repeat classes in selectors 1..10
whitelist [] Restrict output CSS to whitelist tachyons classes
stripComments false strip comments true, false

License

MIT

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published