我正在使用 bootstrap-sass (3.2.0.0)。我正在学习教程,并在 app/assets/stylesheets/scaffolds.css.scss
中使用了以下代码。
.timestamp {
color: $grayLight;
}
结果是一个错误,表明未定义有值(value)的 $grayLight。我找到了a link表示命名已从 $grayLight 更改为 $gray-light。
我在互联网上寻找有关定义颜色的文档,但没有找到。我认为这种文档应该存在。完全不知道可以使用哪种颜色代码。
即使我使用了 find 。 -type f -exec grep -H "gray-light"{}\;
没有这样的文件定义颜色代码。
最佳答案
首先,确保您正在浏览 gem 源...bundle open bootstrap-sass
。然后浏览到:vendor/assets/stylesheets/bootstrap/_variables.scss
为方便起见,在此复制相关部分:
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
$gray-darker: lighten(#000, 13.5%) !default; // #222
$gray-dark: lighten(#000, 20%) !default; // #333
$gray: lighten(#000, 33.5%) !default; // #555
$gray-light: lighten(#000, 60%) !default; // #999
$gray-lighter: lighten(#000, 93.5%) !default; // #eee
注意:这是来自 bootstrap-sass v3.1.0.2,因此在 3.2.0.0 中可能有所更改。
我发现 bootstrap-sass gem 的 SCSS 文件非常容易阅读,所以我经常跳到这个文件的源代码。祝你好运!
关于css - bootstrap-sass 颜色代码在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24970862/