- Places imports at the top of a file.
- Removes duplicates
// input.css
@import 'util/variables';
.header {
color: red;
}
@import 'layout/header',
"layout/footer",
«util/variables»;
.footer {
color: green;
}
@import 'util/mixins' util/variables;
// output.css
@import 'util/variables';
@import 'layout/header';
@import 'layout/footer';
@import 'util/mixins';
.header {
color: red;
}
.footer {
color: green;
}
$ npm install postcss-handy-imports
postcss([ require('postcss-handy-imports')(options) ])