Skip to content

Commit 1b126f8

Browse files
tohuwhudochenkov
authored andcommitted
Added instructions for postcss-cli to README (#73)
* Added instructions for postcss-cli to README * Added installation instructions for postcss-cli
1 parent a34d89b commit 1b126f8

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,44 @@ grunt.initConfig({
142142
});
143143
```
144144

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+
145183
## Related tools
146184

147185
[stylelint] and [stylelint-order] help lint style sheets and let you know if style sheet order is correct. Also, they could autofix style sheets.

0 commit comments

Comments
 (0)