使用bootstrap-sass gem覆盖Rails中的Bootstrap变量 [英] Overriding Bootstrap variables in Rails with bootstrap-sass gem

查看:123
本文介绍了使用bootstrap-sass gem覆盖Rails中的Bootstrap变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Thomas McDonald的 bootstrap-sass gem(Bootstrap 3.0)。我遵循Daniel Kehoe的
Bootstrap和Rails 教程。

I am using the bootstrap-sass gem (Bootstrap 3.0) by Thomas McDonald. I've followed the Bootstrap and Rails tutorial by Daniel Kehoe.

我有 application.css.scss ,其顶部有以下:

 /*
 *= require_self
 *= require_tree .
 */

我有 framework_and_overrides.css.scss 其中有这一行:

@import "bootstrap";



现在我试图覆盖引导变量( $ body-bg:#f00; )我在这里找到这里,并将它们放在这两个文件中,但没有任何更改。

Now I tried overriding bootstrap variables ($body-bg: #f00;) I found here and placing them in either of these two files but nothing changes. What am I doing wrong?

推荐答案

您可以通过重新定义 code> @import 指令。

You can override variables by simply redefining the variable before the @import directive.

例如:

$navbar-default-bg: #312312;
$light-orange: #ff8c00;
$navbar-default-color: $light-orange;

@import "bootstrap";

这篇关于使用bootstrap-sass gem覆盖Rails中的Bootstrap变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆