I have a new rails project, and it is using the following gem:
gem 'bootstrap-sass'
I am using the horizontal-form CSS class - which has by default:
text-align:right; as part of .horizontal-form
I want to override this so that all labels have text-align:left;
In my rails project, under stylesheets I have the following:
1st_load_framework.scss
Which has :
// import the CSS framework
@import "bootstrap-sprockets";
@import "bootstrap";
...bunch of css classes and @variables.
//I have tried adding:
.horizontal-form{ text-align:left; } into this file however, it is overriding by the generated sass CSS.
application.scss
Which has :
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
@import "bootstrap-sprockets";
@import "bootstrap";
*= require_tree .
*= require_self
*/
.sign-up{
background-color:#95ccfb;
}
.log-in{
background-color:#75d86a;
}
.horizontal-form{ text-align:left !important; }
I have also tried adding :
.horizontal-form{ text-align:left; }
to the bottom of application.scss to no avail.
How can I make an override like this? I don't believe this particular class has a sass variable, so I am looking for a normal CSS override here - something scalable for the rest of my project in rails would be great.
Using Rails 5.1.1, bootstrap 3
Please help!