I've downloaded bootstrap-rtl
from https://github.com/morteza/bootstrap-rtl in order to add Right to Left support for bootstrap. I put the bootstrap-rtl.css
file in app/assets/stylesheets
directory, but some of the styles are not applied. for example it doesn't affect navbar. Should I put that file in another location?
Asked
Active
Viewed 1,599 times
1

Sajad Rastegar
- 3,014
- 3
- 25
- 36
-
1I guess you are importing bootstrap using `@import "bootstrap";`, try importing it before `bootstrap-rtl`. Rename `bootstrap-rtl.css` to `bootstrap-rtl.css.scss` and add `@import "bootstrap";` as first line (remove it from elsewhere) and see what happens – Ruby Racer Oct 06 '14 at 19:36
-
@Ruby Racer Why I need to import `bootstrap-rtl` in `custom.css.scss`? I simply put `bootstrap-rtl.css` in `app/assets/stylesheets` directory. Aren't all the css files in that directory applied automatically? – Sajad Rastegar Oct 06 '14 at 19:49
-
@Ruby Racer Yes I have imported `bootstrap-sprockets` and `bootstrap`. – Sajad Rastegar Oct 06 '14 at 19:55
-
1Try defining the same thing twice and differently. The latter will override the former. That's why I'm telling you to force loading rtl AFTER standard bootstrap. – Ruby Racer Oct 06 '14 at 19:57
-
@RubyRacer Thanks, It works! Isn't this method inefficient? Isn't `bootstrap-rtl` applied twice this way? – Sajad Rastegar Oct 06 '14 at 20:11
-
1For bootstrap, adding it to sprockets will import it to your library but it won't add it to the project. You need to also import it in a scss file. So, if you're not explicitly importing bootstrap-rtl and you add bootstrap-rtl.css, you're doing basically the same thing... once – Ruby Racer Oct 06 '14 at 20:52
-
I think using original bootstrap is better. After editing variables and compile process, use http://cssjanus.commoner.com to convert it. – Morteza Mar 12 '15 at 08:32