【发布时间】:2021-09-04 01:18:37
【问题描述】:
我尝试用我自己的值覆盖一些默认变量。
为此,我使用了 Bootstrap 文档中的演示代码:
// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
@import "../bootstrap/scss/functions";
// 2. Include any default variable overrides here
// Default variable overrides
$body-bg: #000;
$body-color: #111;
$table-cell-vertical-align: middle;
// 3. Include remainder of required Bootstrap stylesheets
@import "../bootstrap/scss/variables";
@import "../bootstrap/scss/mixins";
@import "../bootstrap/scss/root";
// 4. Include any optional Bootstrap CSS as needed
@import "../bootstrap/scss/utilities";
@import "../bootstrap/scss/reboot";
@import "../bootstrap/scss/type";
@import "../bootstrap/scss/images";
@import "../bootstrap/scss/containers";
@import "../bootstrap/scss/grid";
@import "../bootstrap/scss/helpers";
// 5. Optionally include utilities API last to generate classes based on the Sass map in `_utililies.scss`
@import "../bootstrap/scss/utilities/api";
// 6. Add additional custom code here
覆盖适用于$body-bg 和$body-color。
但是$table-cell-vertical-align的变化没有效果。
我还看到了answer which points out the importance of the order。 但在我看来,我文件中的顺序是正确的。
即使我将$table-cell-vertical-align 放在文件末尾,它也不起作用。
我错过了什么吗?
【问题讨论】:
-
您似乎不是在导入“../bootstrap/scss/tables”文件。
-
我刚才看到了... :-) 谢谢!如果你把它作为答案,我会接受它。
标签: css sass bootstrap-5 dart-sass