【发布时间】:2014-02-12 22:12:58
【问题描述】:
我正在尝试使用 Twitter Bootstrap for SASS,但目前它没有集成到 Rails 项目中,我不需要从 Compass 获得的东西。我(想我)想要一个 Ruby 脚本来生成我的 CSS、JS 和字体文件并将它们放在正确的位置,但是花了几个小时在文档中转圈,我无法弄清楚这一点。
我有一个类似的目录:
site/
css/
bootstrap_variables.scss
application.scss
site.scss
fonts/
index.html
js/
css/bootstrap_variables.scss 包含我对 Bootstrap 的默认变量的自定义变体。
css/site.scss 包含特定于站点的非引导程序 CSS。
css/application.scss 看起来像这样:
@import "bootstrap_variables.scss";
// Import Bootstrap modules I need, but not others.
@import "bootstrap/variables";
@import "bootstrap/mixins";
// ... etc
@import "site.scss"
我已经安装了bootstrap-sass gem。现在我想要一个脚本:
- 使用 SASS 处理
css/application.scss并输出css/application.css。 - 将我需要的 Bootstrap JavaScript 放入
js/的单个文件中。 (如何指定需要哪些 JS 模块?) - 如果我使用 Bootstrap 的图标,请将 glyphicons 字体放入
fonts/。
如果这听起来很疯狂,而我完全错了,也请随时告诉我!
【问题讨论】:
-
抱歉这个无用的评论,但是这个问题需要
CSS标签吗? -
你需要一个sass编译器,compass有什么问题?
-
@HashemQolami 你是对的,是的 - 我猜我的头被 CSS 卡住了,但这里不相关。
-
@SergioAristizábal 也许我理解错了,但 SASS 不需要 Compass - it can generate compiled CSS by itself。
-
我花了一些时间使用 Compass 并让它使用
bootstrap-sassgem 生成自定义 Bootstrap CSS。但看不到如何让它处理它的 JS 或字体。
标签: ruby twitter-bootstrap sass