From 4841830d22759748b88e32870ef452cbe31d03cd Mon Sep 17 00:00:00 2001 From: Tomasz Rychtyk Date: Thu, 12 Sep 2013 17:17:47 +0100 Subject: [PATCH] Fixed problem with @keyframes syntax --- lessc.inc.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lessc.inc.php b/lessc.inc.php index f396e8f1..ccc382b1 100644 --- a/lessc.inc.php +++ b/lessc.inc.php @@ -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) {