blob: 6dda92d2cf67977a015b76c9c7f49293eb3166fe [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
var autoprefixer = require('autoprefixer');
var fs = require('fs');
var path = require('path');
var rework = require('rework');
var colors = require('rework-plugin-colors');
var imprt = require('rework-import');
var vars = require('rework-vars');
var infile = process.argv[2];
if (!infile) {
throw new Error('Usage: node rework-css.js <infile>');
}
var css = fs.readFileSync(infile, 'utf8');
css = rework(css)
.use(imprt({path: path.dirname(infile)}))
.use(vars())
.use(colors())
.toString();
css = autoprefixer().process(css).css;
process.stdout.write(css);