【发布时间】:2022-01-07 17:01:05
【问题描述】:
我不想覆盖 Bootstrap SASS 中的 $blue 变量。 $primary 和 $secondary 正在工作,但不是 $blue, $teal, $orange 和其他不是主题颜色的其他颜色。这是我的 SASS 文件:
// COLORS
$primary: #D91473;
$secondary: #2E3092;
$blue: #349DD6;
$teal: #309C9E;
@import '../../node_modules/bootstrap/scss/functions';
@import '../../node_modules/bootstrap/scss/variables';
// Bootstrap Main
@import '../../node_modules/bootstrap/scss/bootstrap';
我的标记很简单:
<div class="container-fluid bg-blue">
<p>test</p>
</div>
正如您在课堂上看到的那样,它是 bg-blue,它不起作用,但 bg-primary 起作用。
【问题讨论】:
-
看起来
bg-blue类在引导程序中的任何地方都不存在。您的覆盖实际上可能正在工作,您可以通过在您自己的类中直接使用$blue变量来测试它是否有效。