仅限 Bootstrap 4 flex 网格系统 [英] Bootstrap 4 flex grid system only
问题描述
所以在 bootstrap3 中我们有自定义和下载"选项,我们可以只下载我们需要的任何东西.现在 bootstrap 4 支持 flexbox,我只想下载 bootstrap 4 的 flex grid 系统,我再也看不到那个选项了.有没有办法做到这一点?
更新(2019 年 7 月)
随着
<小时>旧答案:
在这个 Alpha 阶段,您可以根据 bootstrap V4 Alpha 文档
<块引用>Bootstrap 终于支持 Flexbox.选择加入新的 CSS使用变量的轻弹或交换的布局样式样式表.
<块引用>如果您熟悉在 Sass 或任何其他 CSS 中修改变量预处理器——您将在家即可进入 flexbox 模式.
- 打开
_variables.scss
文件并找到$enable-flex
变量. - 将其从
false
更改为true
. - 重新编译,大功告成!
或者,如果你不需要源 Sass 文件,你可以交换默认的 Bootstrap 编译 CSS 和编译后的 flexbox变化.前往下载页面了解更多信息.
So in bootstrap3 we had the 'Customize and download' option, which we could download only whatever we needed. Now that bootstrap 4 supports flexbox, I only wanna download the flex grid system of bootstrap 4 and I cant see that option anymore. is there any way to do this ?
UPDATE (JULY 2019)
With the release of v4 you can simply use either bootstrap-grid.css
or bootstrap-grid.min.css
, it only includes grid system and flex utilities
Old Answer:
At this Alpha stage, you can toggle between true/false for using flexbox (if using a CSS preprocessor) as per bootstrap V4 Alpha docs
Flexbox support has finally come to Bootstrap. Opt-in to the new CSS layout styles with the flick of a variable or the swap of a stylesheet.
If you’re familiar with modifying variables in Sass—or any other CSS preprocessor—you’ll be right at home to move into flexbox mode.
- Open the
_variables.scss
file and find the$enable-flex
variable.- Change it from
false
totrue
.- Recompile, and done!
Alternatively, if you don’t need the source Sass files, you may swap the default Bootstrap compiled CSS with the compiled flexbox variation. Head to the download page for more information.
这篇关于仅限 Bootstrap 4 flex 网格系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!