Skip to content


Subversion checkout URL

You can clone with
Download ZIP


import-url not recognized #14

kclair opened this Issue · 4 comments

2 participants



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.


You should @import the other .less file.


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


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.


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

@kclair kclair closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.