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 9183771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:53:10+00:00 2026-06-17T18:53:10+00:00

I am trying to use LESS variables in Twitter Bootstrap but cant seem to

  • 0

I am trying to use LESS variables in Twitter Bootstrap but cant seem to get them to render in my application.css file

So when i setup bootstrap i installed

rails generate bootstrap:install --less

Which gave me my

bootstrap_and_overrides.css.less 

So my understanding is that in this file i can set my LESS variables like so

@white:#FFFFFF;

and then in my css file i can just call them like so

color: @white;

In my bootstrap.less file i call these

@import "twitter/bootstrap/bootstrap";
@import "twitter/bootstrap/responsive";
@import "twitter/bootstrap/variables.less";

and in my application.css file i call the bootstrap file

*= require bootstrap_and_overrides

Gemfile

gem 'less-rails'

This doesnt work and my variables are not being applied

Can anyone see anything that i am doing wrong?

any help appreciated

Thanks

  • 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-17T18:53:11+00:00Added an answer on June 17, 2026 at 6:53 pm

    … I can set my LESS variables like so

    @white:#FFFFFF;

    and then in my css file i can just call them like so color: @white;

    Hi, I’m not so familiar with using LESS inside Rails, so apologies if I’m off here.

    I can only use less variables inside a file which will be compiled. So for example I can set
    @white:#FFFFFF in a variables.less file

    perhaps in a custom.less file I have
    .light{
    color:@white;
    }

    After I’ve compiled everything I can use the class .light in my CSS

    So to address your quote above, you can set your less variables like
    @white:#ffffff
    and then you can use that variable in another less file which will be compiled, but not directly in a CSS file.

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

Sidebar

Related Questions

I'm doing a style.php CSS file so I can use some dynamic variables in
I am trying use gem tire to search in my application. I have tables
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
What are the best ways to use LESS for CSS. Basically should the Devs
I know that there is no if/else in LESS CSS and use-cases where if/else
I'm trying to use opera dragonfly for debugging, it seems quite nice, but I'm
I am trying to understand the concept behind logic-less temlpates, but I'm finding myself
I am trying to use df.apply() function in pandas but getting the following error.
I'm trying to get Guy Bedfords less plugin for RequireJS to pull some common
I'm using less.js for better responsive css design, but now I encounter NETWORK_ERR while

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.