[英]How to enable flexbox in bootstrap 4 rails gem
I started a rails project and added bootstrap gem to the Gemfile. 我启动了一个rails项目,并将bootstrap gem添加到Gemfile中。 Now I want to enable flexbox which according to the bootstrap 4 documentation is done by editing _variable.scss
$enable-flex: true
. 现在我想启用flexbox,根据bootstrap 4 文档,它是通过编辑_variable.scss
$enable-flex: true
。
I added $enable-flex: true
in global.scss
and added this file to my application.scss
. 我在
global.scss
添加了$enable-flex: true
,并将此文件添加到了application.scss
。 But it's not working. 但这不起作用。
Add $enable-flex: true;
添加
$enable-flex: true;
in application.scss
before the line with @import "bootstrap";
在
application.scss
,在@import "bootstrap";
行之前 @import "bootstrap";
it works: 有用:
application.scss
$enable-flex: true;
// Custom bootstrap variables must be set or imported before bootstrap itself.
@import "bootstrap";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.