Skip to content

Commit

Permalink
fix(issue #4235) style must not have space
Browse files Browse the repository at this point in the history
fixes issue #4235 where container query style would have invalid space
after keyword
  • Loading branch information
puckowski committed Oct 22, 2023
1 parent af51cc8 commit 6c3ecb7
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
7 changes: 6 additions & 1 deletion dist/less.js
Original file line number Diff line number Diff line change
Expand Up @@ -4879,7 +4879,12 @@
} while (e);
parserInput.forget();
if (nodes.length > 0) {
return new (tree.Expression)(nodes);
if (nodes[0] && (nodes[0] instanceof tree.Keyword) && nodes[0].value === 'style') {
return new (tree.Expression)(nodes, true);
}
else {
return new (tree.Expression)(nodes);
}
}
},
mediaFeatures: function (syntaxOptions) {
Expand Down
2 changes: 1 addition & 1 deletion dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/less.min.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/less/dist/less.js
Original file line number Diff line number Diff line change
Expand Up @@ -4879,7 +4879,12 @@
} while (e);
parserInput.forget();
if (nodes.length > 0) {
return new (tree.Expression)(nodes);
if (nodes[0] && (nodes[0] instanceof tree.Keyword) && nodes[0].value === 'style') {
return new (tree.Expression)(nodes, true);
}
else {
return new (tree.Expression)(nodes);
}
}
},
mediaFeatures: function (syntaxOptions) {
Expand Down
2 changes: 1 addition & 1 deletion packages/less/dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/less/dist/less.min.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion packages/less/src/less/parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) {

parserInput.forget();
if (nodes.length > 0) {
return new(tree.Expression)(nodes);
if (nodes[0] && (nodes[0] instanceof tree.Keyword) && nodes[0].value === 'style') {
return new(tree.Expression)(nodes, true)
} else {
return new(tree.Expression)(nodes);
}
}
},

Expand Down
2 changes: 1 addition & 1 deletion packages/test-data/css/_main/container.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
margin: 0.5em 0 0 0;
}
}
@container card (inline-size > 30em) and style (--responsive: true) {
@container card (inline-size > 30em) and style(--responsive: true) {
.card-content {
grid-template-columns: 1fr 2fr;
grid-template-rows: auto 1fr;
Expand Down

0 comments on commit 6c3ecb7

Please sign in to comment.