Stylecow core
Fast and furious css processor. For node >= v4.0
Simple usage example:
"use strict";
let stylecow = require('stylecow-core');
let tasks = (new stylecow.Tasks())
.minSupport({
explorer: 9,
firefox: 30,
chrome: 30,
safari: 6,
ios: 6,
opera: 12
})
.use(require('stylecow-plugin-prefixes'))
.use(require('stylecow-plugin-nested-rules'))
.use(require('stylecow-plugin-color'))
.addTask({
filter: {
type: 'Keyword',
name: 'grey'
},
fn: keyword => keyword.name = 'gray'
});
let coder = new stylecow.Coder('minify');
let css = stylecow.parseFile('styles.css');
tasks.run(css);
let code = coder.run(css);
console.log(code.css);