【发布时间】:2013-07-13 17:45:34
【问题描述】:
在 stylesheets/bootstrap 目录中,我有:
_variables.scss 我有:
$black: #000 !default;
$grayDark: #333 !default;
...
$textColor: $grayDark !default;
这个文件被导入到 bootstrap.scss 文件中:
// Core variables and mixins
@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc
@import "bootstrap/mixins";
...
在 stylesheets 目录中,我有 bootstrap_include.scss
@import "bootstrap/bootstrap";
@import "bootstrap/responsive";
我想将默认文本覆盖为黑色,因此我创建了一个自定义变量文件并将其导入到我的自定义引导文件中
_variables_custom.scss:
$black: #000 !default;
$textColor: $black !default;
然后在 bootstrap_custom.scss
@import "variables_custom";
终于在application.css.scss
*= require bootstrap_custom
*= require bootstrap_include
当我刷新页面时,bootstrap_custom 总是为空,我是一个 css 新手,为什么它不起作用?
谢谢
不确定这是否不错,但我使用以下方法解决了它:
我的 bootstrap_custom 现在包括
$black: #000 !default;
$textColor: $black !default;
@import "bootstrap/bootstrap";
@import "bootstrap/responsive";
而我的 application.css.scss 现在只包含
*= require bootstrap_custom
【问题讨论】:
标签: ruby-on-rails twitter-bootstrap sass