File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1358,6 +1358,7 @@ protected function evalSelectors($selectors)
13581358
13591359 // after evaluating interpolates, we might need a second pass
13601360 if ($ this ->shouldEvaluate ) {
1361+ $ selectors = $ this ->revertSelfSelector ($ selectors );
13611362 $ buffer = $ this ->collapseSelectors ($ selectors );
13621363 $ parser = $ this ->parserFactory (__METHOD__ );
13631364
@@ -1470,6 +1471,24 @@ function ($value, $key) use (&$compound) {
14701471 return $ parts ;
14711472 }
14721473
1474+ /**
1475+ * Parse down the selector and revert [self] to "&" before a reparsing
1476+ * @param array $selectors
1477+ * @return array
1478+ */
1479+ protected function revertSelfSelector ($ selectors ) {
1480+ foreach ($ selectors as &$ part ) {
1481+ if (is_array ($ part )) {
1482+ if ($ part === [Type::T_SELF ]) {
1483+ $ part = '& ' ;
1484+ } else {
1485+ $ part = $ this ->revertSelfSelector ($ part );
1486+ }
1487+ }
1488+ }
1489+ return $ selectors ;
1490+ }
1491+
14731492 /**
14741493 * Flatten selector single; joins together .classes and #ids
14751494 *
You can’t perform that action at this time.
0 commit comments