File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change 9
9
10
10
## Usage
11
11
12
+ - [ Node] ( #a-Node )
13
+ - [ PostCSS] ( #a-PostCSS )
14
+ - [ Gulp] ( #Gulp )
15
+ - [ webpack] ( #webpack )
16
+
12
17
Add [ Postcss salad] to your build tool:
13
18
14
19
``` bash
15
20
npm install postcss-salad --save-dev
16
21
```
17
22
18
- #### Node
23
+ #### [ Node] ( id:a-Node )
19
24
20
25
``` js
21
26
require (' postcss-salad' ).process (YOUR_CSS , { /* options */ });
22
27
```
23
28
24
- #### PostCSS
29
+ #### [ PostCSS] ( id:a-PostCSS )
25
30
26
31
Add [ PostCSS] to your build tool:
27
32
@@ -37,7 +42,7 @@ postcss([
37
42
]).process (YOUR_CSS , /* options */ );
38
43
```
39
44
40
- #### Gulp
45
+ #### [ Gulp] ( id:Gulp )
41
46
42
47
Add [ Gulp PostCSS] : to your build tool:
43
48
@@ -60,10 +65,25 @@ gulp.task('css', function () {
60
65
);
61
66
});
62
67
```
68
+ #### [ webpack] ( id:webpack )
63
69
64
- ## options
70
+ ``` js
71
+ module .exports = {
72
+ module: {
73
+ loaders: [
74
+ {
75
+ test: / \. css$ / ,
76
+ loader: " style-loader!css-loader!postcss-loader"
77
+ }
78
+ ]
79
+ },
80
+ postcss : function () {
81
+ return [require (' postcss-salad' )];
82
+ }
83
+ }
84
+ ```
65
85
66
- ** you can change the plugin's behaviour by the options**
86
+ ## options
67
87
68
88
沙拉里每一个特性都是依赖于对应的插件的,因此他们都有自己的配置。 你可以通过 features 属性类为每一个插件传入它的配置,假设某个特性传入的值为false,则该特性会被关闭:
69
89
You can’t perform that action at this time.
0 commit comments