TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Twitter's Bootstrap in the Asset Pipeline

46 点作者 dabit超过 13 年前

5 条评论

moe超过 13 年前
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 未加载
mc超过 13 年前
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
mrinterweb超过 13 年前
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.
artemvv超过 13 年前
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.
chrismealy超过 13 年前
Anybody using less and sass together?
评论 #3548825 未加载
评论 #3548836 未加载