File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
# postcss-resolve-nested-selector
2
2
3
+ [ ![ Build Status] ( https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector.svg?branch=master )] ( https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector )
4
+
3
5
Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
4
6
5
7
Tested to work with the syntax of
@@ -20,15 +22,15 @@ For example, given this JS:
20
22
``` js
21
23
var resolvedNestedSelector = require (' postcss-resolve-nested-selector' );
22
24
postcssRoot .eachRule (function (rule ) {
23
- var resolvedSelectors = rule .selectors .map (function (selector ) {
24
- return resolvedNestedSelector (selector, rule);
25
+ rule .selectors .forEach (function (selector ) {
26
+ console . log ( resolvedNestedSelector (selector, rule) );
25
27
});
26
28
});
27
29
```
28
30
29
31
And the following CSS:
30
32
31
- ``` css
33
+ ``` scss
32
34
.foo {
33
35
.bar {
34
36
color : pink ;
@@ -45,7 +47,7 @@ This should log:
45
47
46
48
Or with this CSS:
47
49
48
- ``` css
50
+ ``` scss
49
51
.foo {
50
52
.bar & ,
51
53
a {
Original file line number Diff line number Diff line change 15
15
"ava" : " 0.12.0" ,
16
16
"postcss" : " 5.0.16" ,
17
17
"postcss-nested" : " 1.0.0" ,
18
- "postcss-nesting" : " 2.2.0" ,
19
- "tape" : " 4.4.0"
18
+ "postcss-nesting" : " 2.2.0"
20
19
}
21
20
}
You can’t perform that action at this time.
0 commit comments