Giter Site home page Giter Site logo

tachyons-build-css's Introduction

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

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 true, false
repeat false Whether to repeat classes in selectors false, 1..10
plugins false Additional postcss plugins [my(), other(), plugins()]
atImport {} Options for postcss-import postcss-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.

tachyons-build-css's People

Contributors

cwonrails avatar des-des avatar johno avatar lowmess avatar meghna avatar mrkhdly avatar rivertam avatar tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tachyons-build-css's Issues

BrowserslistError: Unknown browser query `dead`

I am trying to use tachyons with simple react based application.
When I run a command in my scripts like this tachyons src/css/index.css > src/index.css --minify
I see this error

/home/edd/work/testrepo/node_modules/tachyons-build-css/node_modules/caniuse-api/node_modules/browserslist/index.js:37
    throw new BrowserslistError(name);
    ^
BrowserslistError: Unknown browser query `dead`

As I understood the issue is connected with cssnano library.

Use `flexbox: 'no-2009'` or postcss-flexbugs-fixes to fix Flexbox issues

Make postcss build pluggable

As discussed in #5 it'd be nice to be able to pass an optional array of additional postcss plugins. This would allow users to use additional plugins if they desire, while keeping the base Tachyons plugins simple.

Perhaps an API like the following:

tachyonsBuildCss('my css', {
  from: 'input.css',
  to: 'output.css',
  plugins: [my(), other(), plugins()]
})

css-mqpacker is deprecated

Hey There!

Thanks so much for the great toolkit. It's teaching me a lot about postcss.

Please excuse me as I'm coming from SASS where everything's just done for you under the hood.

I was trying to understand which plugins tachyon used by default so that I could extend it for a WYSIWYG editor in a CMS theme, and I learned that css-mqpacker is deprecated. I'm not sure why, but I was able to find 'node-css-mqpacker' from the same author here: https://www.npmjs.com/package/node-css-mqpacker

We're using the deprecated package here:

const queries = require('css-mqpacker')

Not even sure if it matters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.