mirror of
https://github.com/less/less.js.git
synced 2026-02-09 06:25:24 -05:00
variables in media queries in import statements
This commit is contained in:
@@ -1196,6 +1196,7 @@ less.Parser = function Parser(env) {
|
||||
if (dir && (path = $(this.entities.quoted) || $(this.entities.url))) {
|
||||
features = $(this.mediaFeatures);
|
||||
if ($(';')) {
|
||||
features = features && new(tree.Value)(features);
|
||||
var importOnce = dir[1] !== 'multiple';
|
||||
return new(tree.Import)(path, imports, features, importOnce, index, env.rootpath);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ tree.Import = function (path, imports, features, once, index, rootpath) {
|
||||
this.once = once;
|
||||
this.index = index;
|
||||
this._path = path;
|
||||
this.features = features && new(tree.Value)(features);
|
||||
this.features = features;
|
||||
this.rootpath = rootpath;
|
||||
|
||||
// The '.less' extension is optional
|
||||
@@ -33,7 +33,7 @@ tree.Import = function (path, imports, features, once, index, rootpath) {
|
||||
if (! this.css) {
|
||||
imports.push(this.path, function (e, root, imported) {
|
||||
if (e) { e.index = index; }
|
||||
if (imported && that.once) that.skip = imported;
|
||||
if (imported && that.once) { that.skip = imported; }
|
||||
that.root = root || new(tree.Ruleset)([], []);
|
||||
});
|
||||
}
|
||||
@@ -65,10 +65,10 @@ tree.Import.prototype = {
|
||||
eval: function (env) {
|
||||
var ruleset, features = this.features && this.features.eval(env);
|
||||
|
||||
if (this.skip) return [];
|
||||
if (this.skip) { return []; }
|
||||
|
||||
if (this.css) {
|
||||
return this;
|
||||
return new(tree.Import)(this._path, null, features, this.once, this.index, this.rootpath);
|
||||
} else {
|
||||
ruleset = new(tree.Ruleset)([], this.root.rules.slice(0));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user