mirror of
https://github.com/less/less.js.git
synced 2026-01-28 08:38:08 -05:00
remove variables before toCSS
This commit is contained in:
@@ -10,10 +10,12 @@
|
||||
return this._visitor.visit(root);
|
||||
},
|
||||
|
||||
//visitRule: function (ruleNode, visitArgs) {
|
||||
// visitArgs.visitDeeper = false;
|
||||
// return ruleNode;
|
||||
//},
|
||||
visitRule: function (ruleNode, visitArgs) {
|
||||
if (ruleNode.variable) {
|
||||
return [];
|
||||
}
|
||||
return ruleNode;
|
||||
},
|
||||
|
||||
visitComment: function (commentNode, visitArgs) {
|
||||
if (commentNode.isSilent(this._env)) {
|
||||
|
||||
@@ -203,13 +203,13 @@ tree.Ruleset.prototype = {
|
||||
rules.push(rule.toCSS(env));
|
||||
}
|
||||
} else {
|
||||
if (rule.toCSS && !rule.variable) {
|
||||
if (rule.toCSS) {
|
||||
if (this.firstRoot && rule instanceof tree.Rule) {
|
||||
throw { message: "properties must be inside selector blocks, they cannot be in the root.",
|
||||
index: rule.index, filename: rule.currentFileInfo ? rule.currentFileInfo.filename : null};
|
||||
}
|
||||
rules.push(rule.toCSS(env));
|
||||
} else if (rule.value && !rule.variable) {
|
||||
} else if (rule.value) {
|
||||
rules.push(rule.value.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user