File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1359,6 +1359,7 @@ protected function evalSelectors($selectors)
13591359
13601360 // after evaluating interpolates, we might need a second pass
13611361 if ($ this ->shouldEvaluate ) {
1362+ $ selectors = $ this ->revertSelfSelector ($ selectors );
13621363 $ buffer = $ this ->collapseSelectors ($ selectors );
13631364 $ parser = $ this ->parserFactory (__METHOD__ );
13641365
@@ -1440,6 +1441,24 @@ function ($value, $key) use (&$output) {
14401441 return implode (', ' , $ parts );
14411442 }
14421443
1444+ /**
1445+ * Parse down the selector and revert [self] to "&" before a reparsing
1446+ * @param array $selectors
1447+ * @return array
1448+ */
1449+ protected function revertSelfSelector ($ selectors ) {
1450+ foreach ($ selectors as &$ part ) {
1451+ if (is_array ($ part )) {
1452+ if ($ part === [Type::T_SELF ]) {
1453+ $ part = '& ' ;
1454+ } else {
1455+ $ part = $ this ->revertSelfSelector ($ part );
1456+ }
1457+ }
1458+ }
1459+ return $ selectors ;
1460+ }
1461+
14431462 /**
14441463 * Flatten selector single; joins together .classes and #ids
14451464 *
You can’t perform that action at this time.
0 commit comments