Bootstrap 4 whats new
Bootstrap 4 is a major update to the popular front-end framework, introducing several new features, improvements, and changes. Here are some of the key new features and updates in Bootstrap 4:
New Grid System
- The grid system has been rewritten from scratch, with a new flexbox-based approach that provides more flexibility and customization options.
- The grid system is now more responsive and adaptable to different screen sizes and devices.
New Utility Classes
- Bootstrap 4 introduces a new set of utility classes that make it easier to style and layout your content. These classes include:
d-*
classes for display properties (e.g.,d-block
,d-inline-block
)flex-*
classes for flexbox properties (e.g.,flex-grow
,flex-shrink
)text-*
classes for text properties (e.g.,text-left
,text-center
)bg-*
classes for background properties (e.g.,bg-primary
,bg-secondary
)
New CSS Variables
- Bootstrap 4 introduces CSS variables (also known as custom properties) to make it easier to customize the framework's styles. You can use these variables to change the colors, typography, and other visual styles of your application.
Improved Support for HTML5 Elements
- Bootstrap 4 provides improved support for HTML5 elements, such as
<header>
,<nav>
,<main>
,<section>
, and<footer>
. This makes it easier to create semantic and accessible HTML structures.
New Alert and Badge Components
- Bootstrap 4 introduces new alert and badge components that provide more customization options and better accessibility.
Improved Support for RTL Languages
- Bootstrap 4 provides improved support for right-to-left (RTL) languages, making it easier to create applications that support multiple languages and locales.
New JavaScript Components
- Bootstrap 4 introduces new JavaScript components, such as the
tooltip
andpopover
components, which provide more customization options and better accessibility.
Improved Support for Sass
- Bootstrap 4 is now built on top of Sass, a powerful CSS preprocessor that allows you to write more efficient and modular CSS code.
New Documentation and Examples
- Bootstrap 4 comes with new documentation and examples that make it easier to get started and learn how to use the framework.
Breaking Changes
- Bootstrap 4 has several breaking changes compared to Bootstrap 3, including:
- The grid system has been rewritten, so you may need to update your grid layouts.
- The CSS variables have changed, so you may need to update your custom styles.
- The JavaScript components have been rewritten, so you may need to update your JavaScript code.
Overall, Bootstrap 4 is a major update that provides more flexibility, customization options, and accessibility features than its predecessor. However, it also requires some changes to your existing code and layouts, so be sure to review the documentation and examples carefully before upgrading.