Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix for naked url imports #2517

Merged
merged 1 commit into from
Mar 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/less/tree/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ Import.prototype.genCSS = function (context, output) {
}
};
Import.prototype.getPath = function () {
if (this.path instanceof Quoted) {
return this.path.value;
} else if (this.path instanceof URL) {
return this.path.value.value;
}
return null;
return (this.path instanceof URL) ?
this.path.value.value : this.path.value;
};
Import.prototype.isVariableImport = function () {
var path = this.path;
Expand Down
3 changes: 3 additions & 0 deletions test/css/import.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
height: 10px;
color: red;
}
.test-f {
height: 10px;
}
.deep-import-url {
color: red;
}
Expand Down
1 change: 1 addition & 0 deletions test/less/import/import-test-a.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "import-test-b.less";
@import url(import-test-f.less);
@import url("deeper/url-import.less");
@a: 20%;
@import "urls.less";