import-url not recognized #14

kclair opened this Issue Dec 12, 2011 · 4 comments


None yet
2 participants

kclair commented Dec 12, 2011


I'm using rails 3.1.1 and less-rails 2.1.1.

In application.css.less I am loading another less file like so:
//= require layout

In layout.css.less, I'm trying to use image-url like so:
body {
padding-top: 50px;
background: image-url("body_background.png") repeat fixed 0 0 #d5d8db;

The background image is not showing up. When I view the css source on the client, I still see image-url("body_background.png") rather than url(/assets/body_background.png).

I definitely have the asset pipeline enabled, and have configured less explicitly as the stylesheet engine.


metaskills commented Dec 12, 2011

You should @import the other .less file.

kclair commented Dec 13, 2011

I don't understand. Here you say to require less files from application.css: #11

kclair commented Dec 14, 2011

Does the file containing the @import need to be two levels deep from application.css? In your example less-rails-bootstrap-test project, you have:

//= require tree .

the tree contains bootstrap_test.css which contains:
//= require bootstrap_test/less

bootstrap_test/less.css.less finally contains the @import.

I tried to put @import statements into a file one degree away from application.css, like so:

//= require less

@import "layout"

It is not importing anything.

the full file name of the layout file is layout.css.less. i also tried:
@import "layout.css"
@import "layout.css.less"

I also tried renaming the layout file to layout.less, and using @import "layout", but that didn't work either.

kclair commented Dec 14, 2011

Got this working by adding semicolons to the @import statements and by naming the layout file layout.less.

kclair closed this Dec 14, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment