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

Twitter Bootstrap background-image: url() wrong root path #12

Closed
johanbove opened this issue Apr 12, 2012 · 2 comments
Closed

Twitter Bootstrap background-image: url() wrong root path #12

johanbove opened this issue Apr 12, 2012 · 2 comments

Comments

@johanbove
Copy link

WinLESS version 1.5.3
Less.js version 1.3.0

I have copied Twitter Bootstrap LESS files in a folder outside my site's less files for easier customization of Twitter Bootstrap.

I am referring to the LESS files in this folder:

/assets/lib/bootstrap/less/

My bootstrap.less file and variables.less files are in the folder:

/assets/less/

I am referring from my variables.less file to Twitter Bootstrap's:

// Get default Bootstrap variables 
@import "../lib/bootstrap/less/variables.less";

I didn't change the LESS CSS declaration in variables.less:

@iconSpritePath:          "../img/glyphicons-halflings.png";

CSS declaration in sprites.css:

.icon-white {
  background-image: url("@{iconSpritePath}");
}

After compilation using WinLESS the path turns into this:

background-image: url("../lib/bootstrap/less/../lib/bootstrap/less/../img/glyphicons-halflings.png");

Expected output:

background-image: url("../img/glyphicons-halflings.png");

It seems like WinLESS is adding the path to the root automatically to the CSS.

When compiling with less.js the path is correct.

background-image: url("http://localhost:8080/assets/lib/bootstrap/img/glyphicons-halflings.png");
@johanbove
Copy link
Author

Seems like this is a LESS.js issue. I found a work-around here: less/less.js#294

@Irvanabdurrahman
Copy link

great, good job guys..!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants