-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
handle relative URLs in live mode #1926
Comments
I have false set: "When false, URLs are already relative to the entry less file." but the URLs are relative to the document (current web page) not the entry less file |
You need to set it to
or a sort of would be better). |
If I set that to static/less/myapp/main.less
static/less/myapp/mymodule/bar.less
end up as:
rather than:
|
It will. But that's your duty to organize image urls and files in same uniform manner (you can't expect relative urls option to apply selectively, though you can play with |
I don't want it to apply selectively, I want it to behave the same as a compiled css file. |
There should be a third option that rewrites the URLs to be relative to the entry less file. Or the feature should be changed to match the documentation |
Probably you're right, I can see some inconsistency in this situation too (Not sure, I guess it's better to search through old issues to find out if it works this way on purpose or not). |
I think this option should be added, but there should be care made to avoid breaking the defaults |
Im a bit confused. Relative URLs is whether URLs should be made relative to the path from the entry less file to the less file with the URL in. The rootpath option defines a path that should be added to everything and should default to the entry less file. If this isn't working I think your problem might be because your less files are not descendent from your entry less file. I'd gave to create your example and investigate. Pull requests welcome. |
Just posted my updated vision of this issue at #1510 (comment). |
The less live compiler appears to not resolve relative URLs correctly.
When using a file eg "/static/foo/bar/main.less" any url() statements encountered should be resolved relative to that as a base URL. Currently they are passed through unchanged and, because the compiled CSS is included in-line all the URLs are resolved relative to the base of the web page.
url("../../fonts/foo.woff")
should becomeurl("/static/fonts/foo.woff")
url("./foo.img")
should becomeurl("/static/foo/bar/foo.img")
The text was updated successfully, but these errors were encountered: