Twitter bootstrap 无法向我的SCS中的引导$spacer添加新的间隔符
由于某些原因,我无法在我的SCSS文件中的Bootstrap(4.3)中添加新的间隔符。在HTML中,我的自定义样式表位于Bootstrap.css之后 在我的SCSS中,顺序是这样的Twitter bootstrap 无法向我的SCS中的引导$spacer添加新的间隔符,twitter-bootstrap,sass,bootstrap-4,Twitter Bootstrap,Sass,Bootstrap 4,由于某些原因,我无法在我的SCSS文件中的Bootstrap(4.3)中添加新的间隔符。在HTML中,我的自定义样式表位于Bootstrap.css之后 在我的SCSS中,顺序是这样的 $spacer: 1rem !default; $spacers: () !default; $spacers: map-merge((6: ($spacer * 4), 7: ($spacer * 5)), $spacers); /* * Bsp imports */ @import "node_module
$spacer: 1rem !default;
$spacers: () !default;
$spacers: map-merge((6: ($spacer * 4),
7: ($spacer * 5)), $spacers);
/*
* Bsp imports
*/
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/mixins";
@import "node_modules/bootstrap/scss/reboot";
@import "node_modules/bootstrap/scss/variables";
/*
现在,要么我一直盯着一杯太高的马德拉酒,要么我错过了一些明显的东西!不管是哪种情况,请提前感谢
Thomas(单词转到丘脑,Hewson,Microprose,C64)看起来这可能是因为BS参考和自定义Sass的顺序。以下文章似乎提供了正确的方法: 基于此参考,您的代码将是:
/* import only the necessary Bootstrap files */
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
/* -------begin customization-------- */
$spacers: map-merge((
6: ($spacer * 4),
7: ($spacer * 5)), $spacers);
/* -------end customization-------- */
/* finally, import Bootstrap to set the changes! */
@import "bootstrap";
您需要首先@import必要的变量
@import "bootstrap/functions";
@import "bootstrap/variables";
$spacers: map-merge((
6: ($spacer * 4),
7: ($spacer * 5)), $spacers);
@import "bootstrap";
相关:感谢您的帮助,在必需导入和可选导入之间导入了它。