css - Bootstrap 5:变量覆盖不起作用
问题描述
我尝试用我自己的值覆盖一些默认变量。
为此,我使用了 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
and $body-color
。但更改$table-cell-vertical-align
没有任何效果。
我还看到了一个答案,它指出了订单的重要性。但正如我所见,我文件中的顺序是正确的。
即使我把它放在$table-cell-vertical-align
文件的末尾,它也不起作用。
我错过了什么吗?
解决方案
看起来您不是在导入../bootstrap/scss/tables
文件。
推荐阅读
- javascript - 如何将带有反引号的链接路由器包装到卡上并将变量传递给它 Reactjs?
- node.js - 不存在的命令
- javascript - Reactjs 自动更改字符串的最后三个字符?
- c - 我的先生说最好写 0==var(some variable) 而不是 var==0?为什么会这样?
- php - WooCommerce 购物车和结帐中运输方式的额外承运人字段
- python - 在 django 中,我们可以将重定向/HttpResponseRedirect 中的参数传递到另一个视图吗
- api - iOS13 以编程方式访问真深度相机数据和点云?
- javascript - Jquery在祖父母内部强标签中存在的文本之后查找文本
- caching - MISCONF Redis 配置为在 ec2 上保存 RDB 快照问题
- html - 我的 Html Bootstrap 页面背景视频未针对移动设备进行缩放