Skip to content

Commit

Permalink
Merge pull request #3272 from matthew-dean/revert-media-no-ops
Browse files Browse the repository at this point in the history
Reverts operations not being performed in media queries
  • Loading branch information
matthew-dean authored Jul 6, 2018
2 parents be048e7 + c66842f commit eb30fe9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/less/parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ var Parser = function Parser(context, imports, fileInfo) {
nodes.push(e);
} else if (parserInput.$char('(')) {
p = this.property();
e = this.permissiveValue(')');
e = this.value();
if (parserInput.$char(')')) {
if (p && e) {
nodes.push(new(tree.Paren)(new(tree.Declaration)(p, e, null, null, parserInput.i, fileInfo, true)));
Expand Down
2 changes: 1 addition & 1 deletion test/css/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ body {
var: all-and-tv;
}
}
@media screen and (min-width: (60px + 1)) {
@media screen and (min-width: 61px) {
.selector {
foo: bar;
}
Expand Down
3 changes: 1 addition & 2 deletions test/less/media.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@ratio_large: 16;
@ratio_small: 9;

@media all and (device-aspect-ratio: @ratio_large / @ratio_small) {
@media all and (device-aspect-ratio: ~'@{ratio_large} / @{ratio_small}') {
body { max-width: 800px; }
}

Expand Down Expand Up @@ -233,7 +233,6 @@ body {
}
}

// Change in behavior of media queries in 3.5+ - inline expressions not eval'd
@some-var: 60px;
@media screen and (min-width: (@some-var + 1)) {
.selector {
Expand Down

0 comments on commit eb30fe9

Please sign in to comment.