mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Fix url import. Fixes #2089.
This commit is contained in:
@@ -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
3
test/css/import.css
vendored
@@ -20,6 +20,9 @@
|
||||
height: 10px;
|
||||
color: red;
|
||||
}
|
||||
.deep-import-url {
|
||||
color: red;
|
||||
}
|
||||
@media screen and (max-width: 601px) {
|
||||
#css {
|
||||
color: yellow;
|
||||
|
||||
3
test/less/import/deeper/deeper-2/url-import-2.less
Normal file
3
test/less/import/deeper/deeper-2/url-import-2.less
Normal file
@@ -0,0 +1,3 @@
|
||||
.deep-import-url {
|
||||
color: red;
|
||||
}
|
||||
1
test/less/import/deeper/deeper-2/url-import.less
vendored
Normal file
1
test/less/import/deeper/deeper-2/url-import.less
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import url("url-import-2.less");
|
||||
1
test/less/import/deeper/url-import.less
vendored
Normal file
1
test/less/import/deeper/url-import.less
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import url("deeper-2/url-import.less");
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "import-test-b.less";
|
||||
@import url("deeper/url-import.less");
|
||||
@a: 20%;
|
||||
@import "urls.less";
|
||||
Reference in New Issue
Block a user