Fix url import. Fixes #2089.

This commit is contained in:
Luke Page
2014-09-07 14:40:28 +01:00
parent bc42a73886
commit 50e299b8bc
6 changed files with 14 additions and 1 deletions

View File

@@ -75,7 +75,11 @@ Import.prototype.getPath = function () {
return null;
};
Import.prototype.evalForImport = function (env) {
return new(Import)(this.path.eval(env), this.features, this.options, this.index, this.currentFileInfo);
var path = this.path;
if (path instanceof URL) {
path = path.value;
}
return new(Import)(path.eval(env), this.features, this.options, this.index, this.currentFileInfo);
};
Import.prototype.evalPath = function (env) {
var path = this.path.eval(env);

3
test/css/import.css vendored
View File

@@ -20,6 +20,9 @@
height: 10px;
color: red;
}
.deep-import-url {
color: red;
}
@media screen and (max-width: 601px) {
#css {
color: yellow;

View File

@@ -0,0 +1,3 @@
.deep-import-url {
color: red;
}

View File

@@ -0,0 +1 @@
@import url("url-import-2.less");

View File

@@ -0,0 +1 @@
@import url("deeper-2/url-import.less");

View File

@@ -1,3 +1,4 @@
@import "import-test-b.less";
@import url("deeper/url-import.less");
@a: 20%;
@import "urls.less";