File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,44 @@ grunt.initConfig({
142
142
});
143
143
```
144
144
145
+ ### Command Line
146
+
147
+ Add [ postcss-cli] ( (https://github.com/postcss/postcss-cli) ) ) and PostCSS Sorting to your project:
148
+
149
+ ``` bash
150
+ npm install postcss-cli postcss-sorting --save-dev
151
+ ```
152
+
153
+ Create an appropriate ` postcss.config.js ` like this example:
154
+
155
+ ``` js
156
+ module .exports = (ctx ) => ({
157
+ plugins: {
158
+ ' postcss-sorting' : {
159
+ ' order' : [
160
+ ' custom-properties' ,
161
+ ' dollar-variables' ,
162
+ ' declarations' ,
163
+ ' at-rules' ,
164
+ ' rules'
165
+ ],
166
+
167
+ ' properties-order' : ' alphabetical' ,
168
+
169
+ ' unspecified-properties-position' : ' bottom'
170
+ }
171
+ }
172
+ })
173
+ ```
174
+
175
+ Or, simply add the ` 'postcss-sorting' ` section to your existing postcss-cli configuration file. Next, execute:
176
+
177
+ ``` bash
178
+ postcss -c postcss.config.js --no-map -r your_css_file.css
179
+ ```
180
+
181
+ For more information and options, please consult the [ postcss-cli docs] ( https://github.com/postcss/postcss-cli/blob/master/README.md ) .
182
+
145
183
## Related tools
146
184
147
185
[ stylelint] and [ stylelint-order] help lint style sheets and let you know if style sheet order is correct. Also, they could autofix style sheets.
You can’t perform that action at this time.
0 commit comments