Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions lessc.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,24 @@ protected function findClosestSelectors() {
// multiply $selectors against the nearest selectors in env
protected function multiplySelectors($selectors) {
// find parent selectors

$parentSelectors = $this->findClosestSelectors();

$parentSelectors = null;
$isReal = true;

foreach($selectors as $sel) {
// if a selector begins with a digit it means it's not a real selector
// it's most likely a part of an @keyframes expression
// so it must not be prepended with parent selectors
if(preg_match('/^[0-9]+/', $sel)) {
$isReal = false;
break;
}
}

if($isReal) {
$parentSelectors = $this->findClosestSelectors();
}

if (is_null($parentSelectors)) {
// kill parent reference in top level selector
foreach ($selectors as &$s) {
Expand Down