如何创建 _custom.scss 以覆盖 Bootstrap 4 alpha 6 中的变量 [英] How to create _custom.scss to override variable in Bootstrap 4 alpha 6

查看:43
本文介绍了如何创建 _custom.scss 以覆盖 Bootstrap 4 alpha 6 中的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

我注意到你的问题 here这里这里:

<块引用>

☐ 考虑实施 _custom.scss 以实现更简单的内置变量覆盖?

因此,由于您的 Bootstrap 4 没有附带 _custom.scss 文件,您只需要重新创建 bootstrap/scss/_custom.scss.>

然后将 bootstrap/scss/bootstrap.scss 编辑成它应该是的样子:

//核心变量和mixin@import "变量";@import "mixins";@import "自定义";

然后按照自定义变量

<块引用>

Bootstrap 4 [据说] 附带了一个 _custom.scss 文件,用于轻松覆盖 /scss/_variables.scss 中的默认变量.从那里复制相关行并将其粘贴到 _custom.scss 文件中,修改值,然后重新编译您的 Sass 以更改我们的默认值.请务必从覆盖值中删除 !default 标志.

I am trying to customize a Bootstrap 4 alpha 6 theme. I want to copy settings from _variable.scss file to _custom.scss to override. But I didn't find _custom.scss file in source code. How do I add this _custom.scss file in my project?

解决方案

I noted your issue here, here and here:

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

So because your Bootstrap 4 didn't ship with a _custom.scss file, you only need to re-create bootstrap/scss/_custom.scss.

Then edit bootstrap/scss/bootstrap.scss to what it's supposed to be:

// Core variables and mixins
@import "variables";
@import "mixins";
@import "custom";

Then follow 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.

这篇关于如何创建 _custom.scss 以覆盖 Bootstrap 4 alpha 6 中的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆