简体   繁体   English

如何覆盖bootstrap 4 angular中的网格变量

[英]how to override grid variable in bootstrap 4 angular

how to really override bootstrap variables? 如何真正覆盖引导变量? I try this one and not working 我尝试了这个但没有用

// overrides.scss
@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import '~bootstrap/scss/mixins';

@import 'variables.scss'; // my own variables
$grid-columns: 12;
$grid-gutter-width: 16px;
@import '~bootstrap/scss/bootstrap.scss';

// global styles
@import 'overrides.scss';
@import '~bootstrap/scss/bootstrap.scss';

I'm using Angular 2+ and just want to set the gutter width of row from 30px to 16px, any solution to this? 我正在使用Angular 2+,只想将行的装订线宽度从30px设置为16px,对此有解决方案吗?

There's no reason to import Bootstrap twice. 没有理由两次导入Bootstrap。 Just import it once at the end... 最后将其导入一次...

@import 'bootstrap/functions';
@import 'bootstrap/variables';

$grid-columns: 12;
$grid-gutter-width: 16px;

@import 'bootstrap';

Demo: https://www.codeply.com/go/wSyODZFc0b 演示: https//www.codeply.com/go/wSyODZFc0b

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM