[Pkg-javascript-commits] [less.js] 69/88: Fixed that in some situations a mixin call into a referenced file wouldn't import media queries. Fixes #1469

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


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

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

commit bf9c59025bab7401299e8feb3bb26b3b039499c0
Author: Luke Page <luke.a.page at gmail.com>
Date:   Fri Feb 21 11:03:38 2014 +0000

    Fixed that in some situations a mixin call into a referenced file wouldn't import media queries. Fixes #1469
---
 lib/less/tree/media.js                 |  1 +
 test/css/import-reference.css          | 27 +++++++++++++++++++++++----
 test/less/import-reference.less        | 11 +++++++----
 test/less/import/import-reference.less |  8 ++++++++
 4 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/lib/less/tree/media.js b/lib/less/tree/media.js
index 4531cf4..095e43e 100644
--- a/lib/less/tree/media.js
+++ b/lib/less/tree/media.js
@@ -74,6 +74,7 @@ tree.Media.prototype = {
     },
     markReferenced: function () {
         var i, rules = this.rules[0].rules;
+        this.rules[0].markReferenced();
         this.isReferenced = true;
         for (i = 0; i < rules.length; i++) {
             if (rules[i].markReferenced) {
diff --git a/test/css/import-reference.css b/test/css/import-reference.css
index d61df81..f25f4b1 100644
--- a/test/css/import-reference.css
+++ b/test/css/import-reference.css
@@ -1,7 +1,17 @@
-/*
-  The media statement above is invalid (no selector)
-  We should ban invalid media queries with properties and no selector?
-*/
+input[type="text"].class#id[attr=32]:not(1) {
+  color: white;
+}
+div#id.class[a=1][b=2].class:not(1) {
+  color: white;
+}
+ at media print {
+  .class {
+    color: blue;
+  }
+  .class .sub {
+    width: 42;
+  }
+}
 .visible {
   color: red;
 }
@@ -47,3 +57,12 @@
 .visible {
   extend: test;
 }
+.test-mediaq-import {
+  color: green;
+  test: 340px;
+}
+ at media (max-size: 450px) {
+  .test-mediaq-import {
+    color: red;
+  }
+}
diff --git a/test/less/import-reference.less b/test/less/import-reference.less
index cf9da16..93160ab 100644
--- a/test/less/import-reference.less
+++ b/test/less/import-reference.less
@@ -1,10 +1,6 @@
 @import (reference) url("import-once.less");
 @import (reference) url("css-3.less");
 @import (reference) url("media.less");
-/*
-  The media statement above is invalid (no selector)
-  We should ban invalid media queries with properties and no selector?
-*/
 @import (reference) url("import/import-reference.less");
 
 .b {
@@ -15,4 +11,11 @@
 
 .visible:extend(.z all) {
   extend: test;
+}
+
+.test-mediaq-import {
+  .mixin-with-mediaq(340px);
+}
+
+.class:extend(.class all) {
 }
\ No newline at end of file
diff --git a/test/less/import/import-reference.less b/test/less/import/import-reference.less
index 9eac45f..c77f692 100644
--- a/test/less/import/import-reference.less
+++ b/test/less/import/import-reference.less
@@ -40,4 +40,12 @@
     pulled-in: yes;
   }
   /* comment pulled in */
+}
+ at max-size: 450px;
+.mixin-with-mediaq(@num) {
+  color: green;
+  test: @num;
+  @media (max-size: @max-size) {
+    color: red;
+  }
 }
\ 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