mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Fix one issue with media queries and detached rulesets, one to go
This commit is contained in:
@@ -147,6 +147,8 @@ tree.Media.prototype = {
|
||||
}
|
||||
},
|
||||
bubbleSelectors: function (selectors) {
|
||||
if (!selectors)
|
||||
return;
|
||||
this.rules = [new(tree.Ruleset)(selectors.slice(0), [this.rules[0]])];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
tree.Rule = function (name, value, important, merge, index, currentFileInfo, inline) {
|
||||
this.name = name;
|
||||
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
|
||||
this.value = (value instanceof tree.Value || value instanceof tree.Ruleset) ? value : new(tree.Value)([value]);
|
||||
this.important = important ? ' ' + important.trim() : '';
|
||||
this.merge = merge;
|
||||
this.index = index;
|
||||
@@ -46,7 +46,6 @@ tree.Rule.prototype = {
|
||||
evaldValue = this.value.eval(env);
|
||||
|
||||
if (!this.variable && evaldValue.type === "Ruleset") {
|
||||
console.log(this.index);
|
||||
throw { message: "Rulesets cannot be evaluated on a property.",
|
||||
index: this.index, filename: this.currentFileInfo.filename };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user