Relative URLs in LESS files should be relative to the file that defines them.

It is up to the parser and compiler to rewrite them when those files are
imported by another LESS file.

- Modified and added test cases for import and import-once rules
- Fixed difference between client side and server side handling of relative urls
- Added a -rootpath option to lessc to specify another base path for the url
  rewriting. By default, rootpath=''
This commit is contained in:
Salim Bensiali
2012-10-10 15:50:06 +11:00
committed by Luke Page
parent 22a4a0c874
commit e59a93b5fd
13 changed files with 81 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
@import "import-test-d.css";
@import "import/import-test-d.css";
@import "../import-test-d.css";
@import "import/deeper/../import-test-d.css";
#import {
color: #ff0000;
}

16
test/css/import.css vendored
View File

@@ -1,8 +1,10 @@
@import "import-test-d.css";
@import "import/import-test-d.css";
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
@import url(something.css) screen and (color) and (max-width: 600px);
@import "import/../css/background.css";
#import {
color: #ff0000;
}
@@ -21,3 +23,15 @@
width: 100%;
}
}
#logo {
width: 100px;
height: 100px;
background: url('import/imports/../assets/logo.png');
}
@font-face {
font-family: xecret;
src: url('import/imports/../assets/xecret.ttf');
}
#secret {
font-family: xecret, sans-serif;
}