Bootstrap v4.0.0-beta.2 发布了,Bootstrap是快速开发Web应用程序的前端工具包。它是一个CSS和HTML的集合,它使用了最新的浏览器技术,给你的Web开发提供了时尚的版式,表单,buttons,表格,网格系统等等。
此次更新的亮点有:
完整内容请查看。
- Improved Sass map customization with #23260. With this change, it's now possible to override specific key value pairs instead of resetting the entire map, ideal for color scheme customization.
- Restored grid .offset- modifiers in #23445. Originally our intent was to supplement this with our margin utilities, but we underestimated the appeal of fixed number column offsets.
- Remove unnecessary color from .badge, and it's associated $badge-color variable, in #23529.
- Rename grayscale function to gray to avoid breaking CSS native grayscale filter in #23579.
- Renamed .table-inverse, .thead-inverse, and .thead-default to .*-dark and .*-light, matching our color schemes used elsewhere in #23560.
- Responsive tables now generate classes for each grid breakpoint, meaning we've added .table-responsive-{sm,md,lg,xl} to the already present .table-responsive. You might need to adjust your usage depending on when you want a table to resize. See #22804.
- Include two new dist files which contain Popper.js inside bootstrap.bundle.js and bootstrap.bundle.min.js. See #23735.
- Dropped support for Bower as they've deprecated the package manager. See #23568.
- Switched breadcrumbs from float to flexbox in #23683.
- Added new CSS variables in #23761.
- Switched to Stylelint in #23572.
- New Theming page in the docs from #23611
- #23943: Changed the color-yiq from a mixin that included the color property to a function that returns a value, allowing you to use it for any CSS property. For example, instead of color-yiq(#000), you'd write color: color-yiq(#000);.
- New and improved theming in #24429.
bootstrap4 重要革新
- 从Less迁移到Sass: 现在,Bootstrap已加入Sass的大家庭中。得益于Libsass,Bootstrap的编译速度比以前更快;
- 改进网格系统:新增一个网格层适配移动设备,并整顿语义混合。
- 支持选择弹性盒模型(flexbox):这是项划时代的功能——只要修改一个Boolean变量,就可以利用flexbox的优势快速布局。
- 废弃了wells、thumbnails和panels,使用cards代替:Cards是个全新概念,但使用起来与wells、thumbnails及panels很像,且更方便。
- 将所有HTML重置样式表整合到Reboot中:在用不了Normalize.css的地方可以用Reboot了,它提供了更多选项。例如box-sizing: border-box、margin tweaks等都存放在一个单独的 Sass 文件中。
- 新的自定义选项:不再像上个版本一样,将渐变、淡入淡出、阴影等效果分放在单独的样式表中。而是将所有选项都移到一个Sass变量中。想要给全局或考虑不到的角落定义一个默认效果?很简单,只要更新变量值,然后重新编译就可以了。
- 不再支持IE8,使用rem和em单位:放弃对IE8的支持意味着开发者可以放心地利用CSS的优点,不必研究css hack技巧或回退机制了。使用rem和em代替px单位,更适合做响应式布局,控制组件大小。如果要支持IE8,只能继续用Bootstrap 3。
- 重写所有JavaScript插件:为了利用JavaScript的新特性,Bootstrap 4用ES6重写了所有插件。现在提供UMD支持、泛型拆解方法、选项类型检查等特性。
- 改进工具提示和popovers自动定位:这部分要感谢Tether工具的帮助。
- 改进文档:所有文档以Markdown格式重写,添加了一些方便的插件组织示例和代码片段,文档使用起来会更方便,搜索的优化工作也在进行中。
- 更多变化:支持自定义窗体控件、空白和填充类,此外还包括新的实用程序类等。
下载地址: