|
17 | 17 | $ npm install postcss-sorting
|
18 | 18 | ```
|
19 | 19 |
|
20 |
| -## Usage |
21 |
| - |
22 |
| -See [PostCSS] docs for examples for your environment. |
23 |
| - |
24 |
| -#### Gulp |
25 |
| - |
26 |
| -Add [Gulp PostCSS] to your build tool: |
27 |
| - |
28 |
| -```bash |
29 |
| -npm install gulp-postcss --save-dev |
30 |
| -``` |
31 |
| - |
32 |
| -Enable [PostCSS Sorting] within your Gulpfile: |
33 |
| - |
34 |
| -```js |
35 |
| -var postcss = require('gulp-postcss'); |
36 |
| - |
37 |
| -gulp.task('css', function () { |
38 |
| - return gulp.src('./css/src/*.css').pipe( |
39 |
| - postcss([ |
40 |
| - require('postcss-sorting')({ /* options */ }) |
41 |
| - ]) |
42 |
| - ).pipe( |
43 |
| - gulp.dest('./css') |
44 |
| - ); |
45 |
| -}); |
46 |
| -``` |
47 |
| - |
48 |
| -#### Grunt |
49 |
| - |
50 |
| -Add [Grunt PostCSS] to your build tool: |
51 |
| - |
52 |
| -```bash |
53 |
| -npm install grunt-postcss --save-dev |
54 |
| -``` |
55 |
| - |
56 |
| -Enable [PostCSS Sorting] within your Gruntfile: |
57 |
| - |
58 |
| -```js |
59 |
| -grunt.loadNpmTasks('grunt-postcss'); |
60 |
| - |
61 |
| -grunt.initConfig({ |
62 |
| - postcss: { |
63 |
| - options: { |
64 |
| - processors: [ |
65 |
| - require('postcss-sorting')({ /* options */ }) |
66 |
| - ] |
67 |
| - }, |
68 |
| - dist: { |
69 |
| - src: 'css/*.css' |
70 |
| - } |
71 |
| - } |
72 |
| -}); |
73 |
| -``` |
74 |
| - |
75 | 20 | ## Options
|
76 | 21 |
|
77 | 22 | Currently there is only one option.
|
@@ -266,6 +211,61 @@ everything would go into five groups: variables, then group with `position`, the
|
266 | 211 |
|
267 | 212 | Example: `{ "sort-order": "zen" }`
|
268 | 213 |
|
| 214 | +## Usage |
| 215 | + |
| 216 | +See [PostCSS] docs for examples for your environment. |
| 217 | + |
| 218 | +#### Gulp |
| 219 | + |
| 220 | +Add [Gulp PostCSS] to your build tool: |
| 221 | + |
| 222 | +```bash |
| 223 | +npm install gulp-postcss --save-dev |
| 224 | +``` |
| 225 | + |
| 226 | +Enable [PostCSS Sorting] within your Gulpfile: |
| 227 | + |
| 228 | +```js |
| 229 | +var postcss = require('gulp-postcss'); |
| 230 | + |
| 231 | +gulp.task('css', function () { |
| 232 | + return gulp.src('./css/src/*.css').pipe( |
| 233 | + postcss([ |
| 234 | + require('postcss-sorting')({ /* options */ }) |
| 235 | + ]) |
| 236 | + ).pipe( |
| 237 | + gulp.dest('./css') |
| 238 | + ); |
| 239 | +}); |
| 240 | +``` |
| 241 | + |
| 242 | +#### Grunt |
| 243 | + |
| 244 | +Add [Grunt PostCSS] to your build tool: |
| 245 | + |
| 246 | +```bash |
| 247 | +npm install grunt-postcss --save-dev |
| 248 | +``` |
| 249 | + |
| 250 | +Enable [PostCSS Sorting] within your Gruntfile: |
| 251 | + |
| 252 | +```js |
| 253 | +grunt.loadNpmTasks('grunt-postcss'); |
| 254 | + |
| 255 | +grunt.initConfig({ |
| 256 | + postcss: { |
| 257 | + options: { |
| 258 | + processors: [ |
| 259 | + require('postcss-sorting')({ /* options */ }) |
| 260 | + ] |
| 261 | + }, |
| 262 | + dist: { |
| 263 | + src: 'css/*.css' |
| 264 | + } |
| 265 | + } |
| 266 | +}); |
| 267 | +``` |
| 268 | + |
269 | 269 | ## Thanks
|
270 | 270 |
|
271 | 271 | This plugin is heavily inspired by [CSSComb]. Some code logic, tests and documentation parts are taken from this tool.
|
|
0 commit comments