TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Twitter's Bootstrap in the Asset Pipeline

46 pointsby dabitover 13 years ago

5 comments

moeover 13 years ago
I would advise against the 'less-rails-bootstrap', 'compass-bootstrap' gems and whatnot (there's a whole bunch of them).<p>I tried a few of them before resorting to embedding bootstrap as plain less.<p>The gems did either not work at all for me or did not support 2.0-wip, and none had a clear upgrade-path (the sass-compiler chokes on 2.0).<p>Generally I've become strongly biased against the practice of bundling CSS/JS-libraries as gems. It never seems to work quite right (only jquery ever went smoothly for me) and they always seem to introduce an ungodly amount of magic. - When all you really want is drop a few static files into vendor/assets...
评论 #3549124 未加载
评论 #3549576 未加载
评论 #3550150 未加载
mcover 13 years ago
Let me share some quick thoughts and trade offs.<p>I did:<p>(1) Cloned bootstrap into the Rails.root/lib/assets directory, setup config.assets.path, added the require lines to my css and js files.<p>Alternatively I could have done:<p>(2) Used one of the gems mentioned in the comments, added the require lines to my css and js files.<p>In 2.0, there's some manual work involved to get the js pointing to the correct image path, but assuming you've made it that far, those changes are pretty simple to automatically regex.<p>IMO, the biggest difference is the way you go about styling markup. In (1), markup is modified intrusively. The example from the OP can be tolerated. But now imagine if <i>all</i> your divs had a .row or .spanxx classes attached. If that's unacceptable for you, I'd find a gem that you can work with.<p>I was tracking 2.0-wip for a couple of months and it wasn't easy to stay up to date with all the changes. Hopefully it's getting easier for gem authors to track and update
mrinterwebover 13 years ago
I was looking for something like this last night, and I found this project: <a href="https://github.com/seyhunak/twitter-bootstrap-rails" rel="nofollow">https://github.com/seyhunak/twitter-bootstrap-rails</a><p>Using this generator is a very fast way to get your rails app using Twitter's bootstrap.
artemvvover 13 years ago
Just use <a href="https://github.com/varley/sassy-twitter-bootstrap" rel="nofollow">https://github.com/varley/sassy-twitter-bootstrap</a><p>Switching Bootstrap from Less to SCSS is very simple.
chrismealyover 13 years ago
Anybody using less and sass together?
评论 #3548825 未加载
评论 #3548836 未加载