Skip to content

Commit

Permalink
Merge pull request #2517 from seven-phases-max/fix-naked-url-import
Browse files Browse the repository at this point in the history
Quick fix for naked `url` imports
  • Loading branch information
lukeapage committed Mar 21, 2015
2 parents 125a7f0 + 414d21c commit 9de8775
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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";

0 comments on commit 9de8775

Please sign in to comment.