Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install custom theme with twitter-bootstrap-rails

How do I install a custom theme for twitter-bootstrap with the rails asset pipeline?

Should I create a new folder under assets and dump in all of the css, js, image and font files for the theme?

Update: I put all files in my downloaded theme (except the html example files) into a folder in app/assets and added this folder to my asset paths in application.rb:

config.assets.paths << Rails.root.join("app", "assets", "bootstrap_theme")

I added some markup using css classes from the theme but it's not using the theme..

Update: I see that the boostrap theme has the compiled core bootstrap files included inside it. Should I take this to mean it's not intended to be used with Less? Also, should I precompile every asset file individually for production (in application.rb) and in each view include the specific ones needed (and include them after the core bootstrap files)? Then I guess to make any overrides to the theme they'd need to be made directly in the theme files?

Update: I think the problem was that I was requiring the theme css files in my manifest after the bootstrap_and_overrides, assuming the idea of the theme was to change the bootstrap defaults. But requiring some of the theme css before the standard bootstrap_and_defaults works better. It means needing to manually pick and choose which css to load before and after bootstrap.

like image 1000
rigyt Avatar asked Jan 25 '26 01:01

rigyt


1 Answers

I never proved the twitter bootstrap in a rails application but I searched before how can I do it.

If you install the gem less-rails-bootstrap or bootstrap-sass, you can follow the instructions to modify the theme here.

I hope it helps.

like image 144
Pigueiras Avatar answered Jan 27 '26 15:01

Pigueiras



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!