Bootstrap 5.2.0

@mdo July 19, 2022

Bootstrap v5.2.0 is finally stable! We’ve ironed out more bugs, improved more documentation, written new guides and built out new functional environment examples, and so much more!

Keep reading for highlights from both beta and stable releases.

Docs redesign

As previewed in our beta release, the docs have been redesigned! It starts with our new homepage where we have a more complete representation of Bootstrap’s features and an updated design.

New homepage

The docs sidebar navigation has been overhauled to have always expanded groups for easier browsing, a brand new DocSearch experience with search history, and new responsive offcanvas drawers for both sidebar and navbar on mobile.

New docs page

New search

We even updated our version picker in the navbar to cross-link between minor releases!

Docs version picker

Updated buttons and inputs

With our docs redesign, we refreshed buttons and inputs with modified padding and border-radius. Here’s a look at the before and after of our buttons:

Updated buttons

Tons of new CSS variables

Nearly all our components now have CSS variables for real real-time customization, easier theming, and (soon) color mode support starting with dark mode. You can see what CSS variables are available on every docs page, like our buttons:

--#{$prefix}btn-padding-x: #{$btn-padding-x};
--#{$prefix}btn-padding-y: #{$btn-padding-y};
--#{$prefix}btn-font-family: #{$btn-font-family};
@include rfs($btn-font-size, --#{$prefix}btn-font-size);
--#{$prefix}btn-font-weight: #{$btn-font-weight};
--#{$prefix}btn-line-height: #{$btn-line-height};
--#{$prefix}btn-color: #{$body-color};
--#{$prefix}btn-bg: transparent;
--#{$prefix}btn-border-width: #{$btn-border-width};
--#{$prefix}btn-border-color: transparent;
--#{$prefix}btn-border-radius: #{$btn-border-radius};
--#{$prefix}btn-box-shadow: #{$btn-box-shadow};
--#{$prefix}btn-disabled-opacity: #{$btn-disabled-opacity};
--#{$prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--#{$prefix}btn-focus-shadow-rgb), .5);

Values for virtually every CSS variables are assigned via Sass variable, so customization via CSS and Sass are both well supported. Also included for several components are examples of customizing via CSS variables.

Custom button

New _maps.scss

Bootstrap v5.2.0 introduced a new Sass file with _maps.scss that pulls out several Sass maps from _variables.scss to fix an issue where updates to an original map were not applied to secondary maps that extend it. It’s not ideal, but it resolves a longstanding issue for folks when working with customized maps.

For example, updates to $theme-colors were not being applied to other maps that relied on $theme-colors (like the $utilities-colors and more), which created broken customization workflows. To summarize the problem, Sass has a limitation where once a default variable or map has been used, it cannot be updated. There’s a similar shortcoming with CSS variables when they’re used to compose other CSS variables.

This is also why variable customizations in Bootstrap have to come after @import "functions";, but before @import "variables"; and the rest of our import stack. The same applies to Sass maps—you must override the defaults before they get used. The following maps have been moved to the new _maps.scss:

  • $theme-colors-rgb
  • $utilities-colors
  • $utilities-text
  • $utilities-text-colors
  • $utilities-bg
  • $utilities-bg-colors
  • $negative-spacers
  • $gutters

Your custom Bootstrap CSS builds should now look like this with a separate maps import.

  // Functions come first
  @import "functions";

  // Optional variable overrides here
+ $custom-color: #df711b;
+ $custom-theme-colors: (
+   "custom": $custom-color
+ );

  // Variables come next
  @import "variables";

+ // Optional Sass map overrides here
+ $theme-colors: map-merge($theme-colors, $custom-theme-colors);
+ // Followed by our default maps
+ @import "maps";
  // Rest of our imports
  @import "mixins";
  @import "utilities";
  @import "root";
  @import "reboot";
  // etc

New helpers and utilities

We’ve updated our helpers and utilities to make it easier to quickly build and modify custom components:

  • Added new .text-bg-{color} helpers. Instead of setting individual .text-* and .bg-* utilities, you can now use the .text-bg-* helpers to set a background-color with contrasting foreground color.

  • Expanded font-weight utilities to include .fw-semibold for semibold fonts.

  • Expanded border-radius utilities to include two new sizes, .rounded-4 and .rounded-5, for more options.

Expect more improvements here as v5’s development continues.

Responsive offcanvas

Our Offcanvas component now has responsive variations. The original .offcanvas class remains unchanged—it hides content across all viewports. To make it responsive, change that .offcanvas class to any .offcanvas-{sm|md|lg|xl|xxl} class.

New Examples repo and guides

Since the beta, we’ve completely rewritten our Webpack guide and Parcel guide. We’ve also added a new Vite guide.

Bootstrap guides

In addition, we’ve turned every one of those guides into a fully functioning example in our new twbs/examples repo. We’ve even added a couple more examples to the repo, with plans to create even more.

  • Starter – CDN links for our CSS and JS
  • Sass & JS — Import Sass, Autoprefixer, Stylelint, and our JS bundle via npm
  • Sass & ESM JS — Import Sass, Autoprefixer, and Stylelint via npm, and then load our ESM JS with a shim
  • Webpack - Import and bundle Sass and JS with Webpack
  • Parcel - Sass, JS via Parcel
  • Vite - Sass, JS via Vite
  • Bootstrap Icons font - Import Bootstrap Icons via icon font

Each guide matches up to a new example in that repo, and nearly all of them can be immediately available in StackBlitz. Now you don’t even need to have a development environment configured on your computer to get started with Bootstrap.

Examples StackBlitz repo

And did we mention that nearly all our code snippets now have an open in StackBlitz button?

Code snippets StackBlitz

And more!

  • Introduced new $enable-container-classes option. — Now when opting into the experimental CSS Grid layout, .container-* classes will still be compiled, unless this option is set to false. Containers also now keep their gutter values.

  • Thicker table dividers are now opt-in. — We’ve removed the thicker and more difficult to override border between table groups and moved it to an optional class you can apply, .table-group-divider. See the table docs for an example.

  • Scrollspy has been rewritten to use the Intersection Observer API, which means you no longer need relative parent wrappers, deprecates offset config, and more. Look for your Scrollspy implementations to be more accurate and consistent in their nav highlighting.

  • Added .form-check-reverse modifier to flip the order of labels and associated checkboxes/radios.

  • Added striped columns support to tables via the new .table-striped-columns class.

  • Added a new experimental reserved data attribute data-bs-config that can house simple component configuration as a JSON string.

  • Added new smooth-scroll to Scrollspy.

Get the release

Head to for the latest. It’s also been pushed to npm:

npm i bootstrap@v5.2.0

Read the GitHub v5.2.0 changelog for a complete list of changes in this release.

Support the team

Visit our Open Collective page or our team members’ GitHub profiles to help support the maintainers contributing to Bootstrap.

Bootstrap v4.6.2

@mdo July 19, 2022

After several months, we’ve finally shipped Bootstrap v4.6.2, one of our last releases for the v4. It’s a bit of a maintenance patch featuring bug fixes, dependency updates, and some docs updates.

Read on for the highlights or head to the v4.6.x docs to see the latest in action.

What’s changed

There are two big highlights in v4.6.2:

  • First, we’ve added an example to our Collapse plugin docs to show how to use horizontal collapsing. This has long been possible via our JS, but we never had an official class to utilize it.

  • Second, we’ve replaced the deprecated color-adjust with print-color-adjust in our Sass files as part of the Autoprefixer v10.4.6 issues. This should quiet the issues folks have seen from that dependency change. If you’re using our distribution CSS files, like bootstrap.min.css, you may still see the warning.

Beyond that, we’ve addressed a few other things:

  • Tweaked the size of small and .small to compute to a whole pixel value (was 12.8px and now is 14px).
  • Improved accessibility around our dropdowns, color contrast, and role attributes.
  • Fixed some broken links to supporting documentation.
  • Updated dependencies across the board.

Review the GitHub v4.6.2 release changelog for more details.

From here, we don’t expect to ship any meaningful updates to v4.6.x other than major security or dependency updates. Everything will focus on v5 and beyond after this release, starting with the stable release of v5.2.0. Bootstrap 4 will officially end of life January 1, 2023, though you’re obviously welcome to continue using it longer than that. Follow our release repo to stay in the loop on release maintenance status.

Support the team

Visit our Open Collective page or our team members’ GitHub profiles to help support the maintainers contributing to Bootstrap.

Bootstrap Icons v1.9.0

@mdo July 13, 2022

Bootstrap Icons v1.9.0 is here with over 140 new and updated icons, including some longstanding requests for new brands, transportation options, numbers and letters, and so much more. With this release, we’re now at over 1,800 icons!

140+ new icons

Here’s a quick look at all the new icons in v1.9.0:

New love icons in v1.9.0

  • Tons of new brand icons including popular browsers, Ubuntu, Google Play, Android, Dropbox, and many more.
  • New transportation icons including cars, trains, planes, fuel, and common road signs.
  • New number and letter icons for 1-9, R, C, CC, H, and P (for use cases like registered trademark, copyright, Creative Commons, hospital or helicopter, and parking).
  • New medical icons for prescriptions, pills, and viruses.
  • New keyboard icons for tab and escape.
  • New Universal Access cions.
  • Redrawn cup icon, now with a steam variant for hot beverages.
  • Fire, finally!

There are a handful more in there as well, so have a look and put them to use in your next update! In addition, we’ve updated our docs to include mention of Composer installs.

Looking for more new icons? Head to the issue tracker to check for open requests or submit a new one.


To get started, install or update via npm:

npm i bootstrap-icons

Or Composer:

composer require twbs/bootstrap-icons

You can also download the release from GitHub, or download just the SVGs and fonts (without the rest of the repository files).


The Figma file is now published to the Figma Community! It’s the same Bootstrap Icons Figma file you’ve seen from previous releases, just a little more accessible to those using the app.

Using CSS variables in Bootstrap

@mdo May 16, 2022

Bootstrap v5.2.0-beta1 added a slew of CSS custom properties, or CSS variables, across the :root level and all our core components. Here’s a quick look at how you can utilize them in your projects.

With CSS variables, you can now customize Bootstrap easier than ever, and without the need for a CSS preprocessor. All the power of Sass is still there behind the scenes, but CSS variables adds a ton of power for the future. Use and compose new values, updates styles globally without recompiling, set fallback values, setup new color modes, and more.

Let’s dig in.

CSS variables?

Their official name is custom properties, but they’re often referred to as CSS variables thanks to their most immediate use case for setting specific values. Consider reading the MDN CSS custom properties article or the CSS Tricks guide if you need a primer.

In a nutshell, CSS variables allow you to name frequently used values. For example, instead of writing #6f42c1 everywhere, you can set --purple: #6f42c1. Then you can use that variable later on with the var() function.

:root {
  --purple: #6f42c1;
.custom-element {
  color: var(--purple);

We use CSS variables in Bootstrap to set many property values globally, across our components, and in some of our utilities.

Groups of variables

When we talk about CSS variables in Bootstrap, we’re referring to three major groups:

  • Root variables — Globally scoped variables available on the :root element (<html> usually) and accessible by any element throughout the DOM.

  • Component variables — Variables scoped specifically to each component, usually on the component’s base class, and their modifier classes and Sass mixins.

  • Utility variables — Used as modifiers within other utility classes.

Regardless of where they are, all of our CSS variables are prefixed with --bs-, so you know where they’re coming from and how they might be used across codebases that mix Bootstrap’s CSS with additional custom styles. You’ll also notice that we don’t put all our component variables at the root level. This keeps CSS variables scoped to their intended use cases and prevents polluted variables in the global :root scope.

It’s also worth mentioning two larger efforts that are still to come around CSS variables:

  1. Adding CSS variables to all our forms
  2. Adding more nuanced global theme variables and support for color modes like dark mode.

These are likely coming in v5.3.0 (our next minor release after v5.2.0 stablizes), so in the mean time, check out the GitHub repo to see how things are shaping up.

Root variables

Root variables in web inspector

Bootstrap has a ton of root variables and we’ll only be adding more in future updates for the aforementioned color mode support. As of this post, we have the following CSS variables on the :root element:

  • Colors — All named colors, gray colors, and theme colors. This also includes all our $theme-colors in their rgb format.

  • Body font styles — Everything from font-size to color and more, all applied to our <body> element.

  • Shared properties — For property-value pairings that we consider theme specific, like link colors and border styles.

Root CSS variables are used extensively across other parts of Bootstrap to allow you to easily override our default styles at a global level. For example, if you wanted to adjust the default border-radius and link color for our components, you could override a couple variables instead of writing new selectors.

// custom.css
:root {
  --bs-border-radius: .5rem;
  --bs-link-color: #333;

You can even use other root variables to override those values:

// custom.css
:root {
  --bs-border-radius: var(--bs-border-radius-lg);
  --bs-link-color: var(--bs-gray-800);

Without CSS variables, you’d have to use a preprocessor like Sass or write new selectors for every instance of these properties across all components. The former is relatively easy, the latter not so much. CSS variables help solve that.

Component variables

On our components, CSS variables get even more power for customizing. Nearly everything under the Components section in our docs sidebar now has CSS variables available to you:

Scrollspy and close button have no relevant CSS variables, so they’re excluded here.

Throughout our documentation you’ll find examples of customizing our default components by overriding their CSS variables. One great example comes from our own docs where we write our own button styles to create a purple button.

.btn-bd-primary {
  --bs-btn-font-weight: 600;
  --bs-btn-color: var(--bs-white);
  --bs-btn-bg: var(--bd-violet);
  --bs-btn-border-color: var(--bd-violet);
  --bs-btn-border-radius: .5rem;
  --bs-btn-hover-color: var(--bs-white);
  --bs-btn-hover-bg: #{shade-color($bd-violet, 10%)};
  --bs-btn-hover-border-color: #{shade-color($bd-violet, 10%)};
  --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-bg: #{shade-color($bd-violet, 20%)};
  --bs-btn-active-border-color: #{shade-color($bd-violet, 20%)};

Which looks like this:

Custom Bootstrap docs button

Another great example is from our tooltips. You can add custom classes to tooltips and popovers in Bootstrap with data-bs-custom-class="custom-tooltip". Then, with one CSS variable, you can change the tooltip background and arrow color.

.custom-tooltip {
  --bs-tooltip-bg: var(--bs-primary);

Which looks like this:

Custom tooltip

There are dozens of CSS variables in play across our components. All of them are referenced in a new section on the relevant docs page. For example, here are our modal CSS variables. This is in addition to all the Sass variables, mixins, loops, and maps used for each component.

Utility variables

Not every utility class uses CSS variables, but the ones that do gain a good amount of power and customization. Background, border, and color utilities all have what we call “local CSS variables” to improve their usefulness. Each of them uses CSS variables to customize the alpha transparency value of rgba() colors.

Consider our background color utilities, .bg-*. By default each utility class has a local variable, --bs-bg-opacity with a default value of 1. To change the background utility alpha value, you can override that value with your own styles, or some new .bg-opacity-* utilities.

<div class="p-3 bg-success bg-opacity-25">

Here’s how .bg-success looks with all our .bg-opacity-* classes applied:

Background opacity examples

And the same is available for border color opacity (--bs-border-opacity and .border-opacity-*) and text color opacity (--bs-text-opacity and .text-opacity-*). So many color options are now available with these utilities.

By default, we ship with five values for these various opacity utilities.

Class names Alpha value

Expect more CSS variables to make their way into our utilities. There’s a lot of power in real-time customization, even for what we consider immutable styles.

Ready to get started with Bootstrap? Checkout the quick start guide so you can put these new CSS variables to work in your next project!

Bootstrap Icons v1.8.2

@mdo May 13, 2022

Bootstrap Icons v1.8.2 has arrived with some bug fixes and a refreshed docs design to match our main project.

Here’s a quick rundown on the icon fixes:

  • Fix cutoff bank icon
  • Fix house-heart and house-heart-fill fill-rules
  • Fix corners of pentagon icons to match other shapes
  • Fix fill-rule for x-lg
  • Fix cutoff tool icon

On the CSS side, we’ve also added font-display: block to help address our icon font affecting Google Lighthouse scores.

Looking for more new icons? Head to the issue tracker to check for open requests or submit a new one.


To get started, install or update via npm:

npm i bootstrap-icons

Or Composer:

composer require twbs/bootstrap-icons

You can also download the release from GitHub, or download just the SVGs and fonts (without the rest of the repository files).


The Figma file is now published to the Figma Community! It’s the same Bootstrap Icons Figma file you’ve seen from previous releases, just a little more accessible to those using the app.