File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 11# postcss-resolve-nested-selector
22
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+
35Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
46
57Tested to work with the syntax of
@@ -20,15 +22,15 @@ For example, given this JS:
2022``` js
2123var resolvedNestedSelector = require (' postcss-resolve-nested-selector' );
2224postcssRoot .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) );
2527 });
2628});
2729```
2830
2931And the following CSS:
3032
31- ``` css
33+ ``` scss
3234.foo {
3335 .bar {
3436 color : pink ;
@@ -45,7 +47,7 @@ This should log:
4547
4648Or with this CSS:
4749
48- ``` css
50+ ``` scss
4951.foo {
5052 .bar & ,
5153 a {
Original file line number Diff line number Diff line change 1515 "ava" : " 0.12.0" ,
1616 "postcss" : " 5.0.16" ,
1717 "postcss-nested" : " 1.0.0" ,
18- "postcss-nesting" : " 2.2.0" ,
19- "tape" : " 4.4.0"
18+ "postcss-nesting" : " 2.2.0"
2019 }
2120}
You can’t perform that action at this time.
0 commit comments