I'm using django-compressor + LESS.
I have a problem with relative @import
inside .less file and relative url(../image.png)
in included .less
file.
I will explain. I have next folder structure:
common/ # Django app with some common stuff, e.g. common button styles
static/
common/
less/buttons.less
img/icon.png
blog/
static/
blog/
less/blog_buttons.less
Inside buttons.less
I have mixin for button:
.button() {
color: white;
padding: 4px 10px;
background: gray url(../img/icon.png) no-repeat 0 0;
}
Inside blog_buttons.less
I use this mixin:
@import "../../../../common/static/common/less/buttons";
.blog_button {
.button;
background-color: orange;
}
And here is the problem:
when django-compress pre-compiles my blog_buttons.less
- button background points to /static/blog/img/icon.png
(404 Not Found). But it should point to /static/common/img/icon.png
Am I doing something wrong? (I think that it should be a kind of very common situation)