Skip to content

Commit

Permalink
clean normalize before prepending
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean King committed Aug 17, 2015
1 parent a3f3f63 commit 5715213
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 263 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

var postcss = require('postcss'),
fs = require('fs'),
path = require('path');
path = require('path'),
CleanCSS = require('clean-css');

module.exports = postcss.plugin('postcss-normalize', function () {
return function(css) {

var normalize = fs.readFileSync(path.join(__dirname, 'node_modules/normalize.css/normalize.css'), 'utf8');
normalize = new CleanCSS().minify(normalize).styles;

css.prepend(normalize);

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"homepage": "https://github.com/seaneking/postcss-normalize",
"dependencies": {
"clean-css": "^3.3.9",
"normalize.css": "^3.0.3",
"postcss": "^4.1.9"
},
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/test.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.foo {
color: #fff;
}
}
Loading

0 comments on commit 5715213

Please sign in to comment.