File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 65
65
}
66
66
```
67
67
68
+ ## Multiple Namespaces
69
+
70
+ This plugin also supports using multiple namespaces.
71
+
72
+ ``` javascript
73
+ var postcss = require (' postcss' )
74
+ var selectorNamespace = require (' postcss-selector-namespace' )
75
+
76
+ var output = postcss ()
77
+ .use (selectorNamespace ({ selfSelector: ' :--component' , namespace: ' .foo, .bar' }))
78
+ .process (require (' fs' ).readFileSync (' input.css' , ' utf8' ))
79
+ .css
80
+ ```
81
+
82
+ ` input.css `
83
+ ``` css
84
+ :--component {
85
+ color : black ;
86
+ }
87
+
88
+ :--component.danger {
89
+ color : red ;
90
+ }
91
+
92
+ h1 , .h1 {
93
+ font-weight : bold ;
94
+ }
95
+ ```
96
+
97
+ will output the following css:
98
+
99
+ ``` css
100
+ .foo , .bar {
101
+ color : black ;
102
+ }
103
+
104
+ .foo.danger , .bar.danger {
105
+ color : red ;
106
+ }
107
+
108
+ .foo h1 , .bar .h1 {
109
+ font-weight : bold ;
110
+ }
111
+ ```
112
+
68
113
## SCSS support
69
114
70
115
This plugin can also process scss files and output scss again using the
You can’t perform that action at this time.
0 commit comments