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

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

问题描述

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

解决方案

我注意到您的问题此处这里此处


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


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

然后编辑 bootstrap /

  //核心变量和mixins 
@import变量;
@importmixins;
@importcustom;

然后按照 $ b


Bootstrap 4 [据称]附带在 /scss/_variables.scss 为默认变量容易压倒一切的一个 _custom.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天全站免登陆