Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/less/src/less/tree/atrule.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ AtRule.prototype = Object.assign(new Node(), {

declarationsBlock(rules, mergeable = false) {
if (!mergeable) {
return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge}).length === rules.length;
return rules.every(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge});
} else {
return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length;
return rules.every(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); });
}
},

keywordList(rules) {
if (!Array.isArray(rules)) {
return false;
} else {
return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length;
return rules.every(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); });
}
},

Expand Down Expand Up @@ -135,7 +135,7 @@ AtRule.prototype = Object.assign(new Node(), {

if (value) {
value = value.eval(context);
if (value.value && this.keywordList(value.value)) {
if (this.name === '@layer' && value.value && this.keywordList(value.value)) {
value = new Anonymous(value.value.map(keyword => keyword.value).join(', '), this.getIndex(), this.fileInfo());
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/test-data/css/_main/apply.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.box {
@apply h-64 w-64;
}
3 changes: 3 additions & 0 deletions packages/test-data/less/_main/apply.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.box {
@apply h-64 w-64;
}
Loading