Wildbit-specific config for postcss-sorting
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
package.json
scss-sorting.json

README.md

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