Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7961293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:59:58+00:00 2026-06-04T04:59:58+00:00

Using rails 3.1 and less-rails (>= 2.1.1): Is anyone out there successfully using @import

  • 0

Using rails 3.1 and less-rails (>= 2.1.1):

Is anyone out there successfully using @import to include local .css.less files? I’m using the following file structure to try to do so:

application.css:

//= require less

less.css.less:

@import "layout"

layout.css.less:

body {
  background-color: white;
}

However the contents of layout.css.less never get loaded. I also tried importing “layout.css” and “layout.css.less” to no avail.

I know that less.css.less gets loaded because if I put some css in there, it gets loaded.

I’m using @import to include the layout.css.less file because (ultimately) I’m trying to use the asset helper image-url, and the author of less-rails told me I need to use @import here

UPDATE:

I added a semicolon to the @import statements, and now rather than nothing from the less.css.less file being loaded, I see the @import statements themselves in the loaded stylesheet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:59:59+00:00Added an answer on June 4, 2026 at 4:59 am

    I got this working by renaming the layout.css.less file to layout.less

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the less-rails gem. Using the following code to mix two colours: @base: #ffdc52;
I'm using less css along with twitter-bootstrap-rails in an app and I can't figure
I have been using the less-rails-bootstrap gem from https://github.com/metaskills/less-rails-bootstrap in my rails 3.1 project.
Wanted to try something new, using the awesome twitter bootstrap and their Less CSS
I am using capistrano in a rails-less environment and I'm having a problem with
i'm using the asset pipeline with rails 3.1 and less. i have my images
I'm using twitter-bootstrap, with LESS and Rails. I want to add a simple spacer
Using Rails 3.1.3 with Ruby 1.9.3p0. I've discovered that by default, Rails does not
Using Rails 3.1.3 and Ruby 1.9.3. I want to give the user a list
Using RAILS 2.2 Hello I am having an issue where my dates are being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.