⚠️ Deprecated, as now stylelint-config-wildbit relies on stylelint-order
plugin.
Sorts CSS properties in the order expected by stylelint-config-wildbit.
- Install dependencies:
npm install --save-dev postcss-scss postcss-sorting
npm install --save-dev wildbit/postcss-sorting-config-wildbit
- Update
gulpfile.js
:
var sorting = require('postcss-sorting');
var sortingConfig = require('./node_modules/postcss-sorting-config-wildbit/scss-sorting.json');
gulp.task('cleanup', function () {
return gulp.src(paths.styles.src + '**/*.scss')
.pipe(
postcss(
[
sorting(sortingConfig)
],
{
syntax: require('postcss-scss')
}
)
)
.pipe(gulp.dest(paths.styles.src));
});
- Add to NPM scripts in
package.json
:
"scripts": {
"cleanup": "gulp cleanup"
}
- Use correct media query @includes at your project:
[
"@include retina",
"@include mobile",
"@include tablet",
"@include desktop"
]
- Run:
npm run cleanup