Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'patch-media-query-variable' of https://github.com/sirla…

…ntis/less.js

Conflicts:
	test/css/media.css
	test/less/media.less
  • Loading branch information...
commit 089ca34dc12311224021c49ebf5967a63a80429f 2 parents 2723c4e + 0086f1b
@cloudhead cloudhead authored
Showing with 21 additions and 7 deletions.
  1. +13 −6 lib/less/parser.js
  2. +3 −0  test/css/media.css
  3. +5 −1 test/less/media.less
View
19 lib/less/parser.js
@@ -1048,7 +1048,7 @@ less.Parser = function Parser(env) {
},
mediaFeature: function () {
- var nodes = [];
+ var e, nodes = [];
do {
if (e = $(this.entities.keyword)) {
@@ -1074,11 +1074,18 @@ less.Parser = function Parser(env) {
},
mediaFeatures: function () {
- var f, features = [];
- while (f = $(this.mediaFeature)) {
- features.push(f);
- if (! $(',')) { break }
- }
+ var e, features = [];
+
+ do {
+ if (e = $(this.mediaFeature)) {
+ features.push(e);
+ if (! $(',')) { break }
+ } else if (e = $(this.entities.variable)) {
+ features.push(e);
+ if (! $(',')) { break }
+ }
+ } while (e);
+
return features.length > 0 ? features : null;
},
View
3  test/css/media.css
@@ -74,3 +74,6 @@
background: red;
}
}
+@media only screen and (max-width: 200px) {
+ width: 480px;
+}
View
6 test/less/media.less
@@ -72,4 +72,8 @@ body {
.b {
.mediaMixin();
-}
+}
+@smartphone: ~"only screen and (max-width: 200px)";
+@media @smartphone {
+ width: 480px;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.