gpt4 book ai didi

sass - 如何创建 _custom.scss 以覆盖 Bootstrap 4 alpha 6 中的变量

转载 作者:行者123 更新时间:2023-12-04 15:31:03 58 4
gpt4 key购买 nike

我正在尝试自定义 Bootstrap 4 alpha 6 主题。我想将设置从 _variable.scss 文件复制到 _custom.scss 以覆盖。但是我在源代码中没有找到 _custom.scss 文件。如何在我的项目中添加这个 _custom.scss 文件?

最佳答案

我注意到您的问题 here , herehere :

☐ Consider implementing a _custom.scss for easier, built-in variable overrides?



所以因为你的 Bootstrap 4 没有附带 _custom.scss文件,你只需要重新创建 bootstrap/scss/_custom.scss .

然后编辑 bootstrap/scss/bootstrap.scss它应该是什么:
// Core variables and mixins
@import "variables";
@import "mixins";
@import "custom";

然后关注 Customising variables

Bootstrap 4 [supposedly] ships with a _custom.scss file for easy overriding of default variables in /scss/_variables.scss. Copy and paste relevant lines from there into the _custom.scss file, modify the values, and recompile your Sass to change our default values. Be sure to remove the !default flag from override values.

关于sass - 如何创建 _custom.scss 以覆盖 Bootstrap 4 alpha 6 中的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43565650/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com