Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 1.23 KB

README.md

File metadata and controls

62 lines (47 loc) · 1.23 KB

⚠️ Deprecated, as now stylelint-config-wildbit relies on stylelint-order plugin.

Wildbit-specific config for postcss-sorting

Sorts CSS properties in the order expected by stylelint-config-wildbit.

How to use

  1. Install dependencies:
npm install --save-dev postcss-scss postcss-sorting
npm install --save-dev wildbit/postcss-sorting-config-wildbit
  1. 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));
});
  1. Add to NPM scripts in package.json:
  "scripts": {
    "cleanup": "gulp cleanup"
  }
  1. Use correct media query @includes at your project:
    [
      "@include retina",
      "@include mobile",
      "@include tablet",
      "@include desktop"
    ]
  1. Run:
npm run cleanup