Skip to content

static-dev/spike-css-standards

Repository files navigation

Spike CSS Standards

npm tests dependencies coverage

standard plugin pack for postcss

Note: This project is in early development, and versioning is a little different. Read this for more details.

Installation

npm install spike-css-standards -S

Note: This project is compatible with node v6+ only

Usage

This is nothing more than a light wrapper around a postcss configuration object. Options are filtered into their appropriate plugins internally. All are optional.

const postcss = require('postcss')
const cssStandards = require('spike-css-standards')

const standards = cssStandards(/* options */)
// returns { parser: 'xxx', plugins: ['xxx'] }

postcss(standards.plugins)
  .process(someCss, { parser: standards.parser })
  .then((res) => { console.log(res.content) })

By default, the css standard plugin pack includes:

Any of these plugins can be customized by passing the options described below. You can also add additional postCSS plugins (like the popular lost grid, for example) on top of this package:

const cssStandards = require('spike-css-standards')
const lost = require('lost')

const css = cssStandards()
css.plugins.push(lost())

Options

Name Description Default
root Root used to resolve path(s) from
path A path to a folder or an array of paths, telling postcss-import where to look for sss or css files to @import.
browsers Browser support provided to autoprefixer > 1%, last 2 versions, Firefox ESR
features Enable or disable cssnext features
warnForDuplicates Enable or disable cssnext duplicate warnings true
rucksack Options passed directly to rucksack
parser custom css parser if desired. pass false to use the default css parser sugarss
minify Minifies the css output by removing excess spaces and line breaks false
appendPlugins Adds a single plugin or array of plugins after all the defaults
prependPlugins Adds a single plugin or array of plugins before all the defaults

License & Contributing

About

A rock solid plugin pack for postcss

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10