[Pkg-javascript-commits] [less.js] 04/25: Fix interpolated import into media #1645

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v1.7.5
in repository less.js.

commit 86c1b0d557af0dcbf9cbb3b30ca4771c463177d2
Author: jurcovicovam <meri at meri.org>
Date:   Mon Jul 28 13:15:50 2014 +0200

    Fix interpolated import into media #1645
    
    Media objects do not have ruleset property. They have rules property which
    always contains one-member array with fake ruleset in it.
---
 lib/less/import-visitor.js | 4 ++--
 test/css/import.css        | 5 +++++
 test/less/import.less      | 6 +++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/lib/less/import-visitor.js b/lib/less/import-visitor.js
index b853b56..36fbdcb 100644
--- a/lib/less/import-visitor.js
+++ b/lib/less/import-visitor.js
@@ -133,7 +133,7 @@
             this.env.frames.shift();
         },
         visitMedia: function (mediaNode, visitArgs) {
-            this.env.frames.unshift(mediaNode.ruleset);
+            this.env.frames.unshift(mediaNode.rules[0]);
             return mediaNode;
         },
         visitMediaOut: function (mediaNode) {
@@ -141,4 +141,4 @@
         }
     };
 
-})(require('./tree'));
+})(require('./tree'));
\ No newline at end of file
diff --git a/test/css/import.css b/test/css/import.css
index 96509af..eea93c2 100644
--- a/test/css/import.css
+++ b/test/css/import.css
@@ -35,3 +35,8 @@
     color: yellow;
   }
 }
+ at media print {
+  body {
+    width: 100%;
+  }
+}
diff --git a/test/less/import.less b/test/less/import.less
index b95ac00..98573cf 100644
--- a/test/less/import.less
+++ b/test/less/import.less
@@ -19,4 +19,8 @@
 
 @import (multiple) "import/import-test-e" screen and (max-width: 602px);
 
- at import (less, multiple) url("import/import-test-d.css") screen and (max-width: 603px);
\ No newline at end of file
+ at import (less, multiple) url("import/import-test-d.css") screen and (max-width: 603px);
+
+ at media print {
+  @import (multiple) "import/import-test-e";
+}
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list