I'm trying to override my application.css with other css, included in header. I want to customize my application.css by this way.
My header
= stylesheet_link_tag 'application', media: 'all'
= stylesheet_link_tag 'customized_css', media: 'all'
Actual
application.css.scss is overriding my tour.css.scss even its is loading before any other css
Edit
The order of files to override the style was right but application's selector specificity beats the tour's, so that's why. Solution - use ID instead.
Thanks to @tonyedwardspz for the solution
The problem you're having is with CSS specificity.
You have declared the css files in the right order. However, the rule within
tour.css.scss
has a lower level of css specificity and therefore cannot override the declaration inapplication.css.scss
.To solve you can do one of three things:
tour.css.scss
application.css.scss
. This will allow the cascade to work as you expect, but may affect other on page elements.You can read more about css specificity here.