Migration·续5
The helper .link-underline is no longer needed in v6.
- Display utilities: added
flow-rootandcontentsoptions. - Sizing utilities:
- Renamed
.mh-*/.mw-*to.max-h-*/.max-w-* - Added
.min-h-*and.min-w-*utilities with two default values,0and100% - Added
auto,min-content,max-content, andfit-contenttowidthandheightutilities. - New dynamic viewport utilities.
.dvh-100and.min-dvh-100setheight: 100dvhandmin-height: 100dvh..dvw-100and.min-dvw-100setwidth: 100dvwandmin-width: 100dvw. The browser updates adv*unit when it expands or retracts a browser interface. Use.dvh-100for full-screen mobile layouts, because the section no longer overflows while a mobile browser shows its URL bar. Note thatdvwdoes not fix the100vwscrollbar overflow, because CSS sizes every viewport width unit as if the scrollbar does not exist. The v5.vh-100,.min-vh-100,.vw-100, and.min-vw-100utilities are unchanged. Addsvh,lvh,svw, andlvwutilities yourself with the utilities API — see Height and Width. - New
color-schemeutilities..color-scheme-light,.color-scheme-dark, and.color-scheme-autoset thecolor-schemeproperty on one element. Use them when one element needs a different scheme than the rest of the page, for example a third-party<iframe>that has no dark mode — see Color scheme. Reboot setscolor-schemeon the page and on everyiframefor you, so you need these utilities only for a single element — see the Reboot section above. - Flex & Grid utilities:
- Added
.place-itemsand.justify-itemsutilities. - Added
.grid-cols-*utilities forgrid-template-columns(1–4 and 6 column layouts),.grid-cols-fillfor spanning all columns,.grid-cols-subgridfor adopting a parent grid's column tracks, and.grid-auto-flowutility. - Container query utilities. New
.contains-inlineand.contains-sizeutilities forcontainer-type. - Ratio helpers are now powered by the utility API and use simplified values without
calc(). - State variants now use prefix syntax. Pseudo-state utility classes like hover and focus variants now use a
state:classprefix pattern (e.g.,hover:opacity-50instead ofopacity-50-hover), matching the responsive prefix convention. - Utility API cleanup. Removed
css-var,css-variable-name, andlocal-varsoptions from the utility API. Use thepropertymap approach for CSS custom properties andvariablesfor static CSS custom properties within utility classes. - Shadows are now layered and themeable.
.shadow,.shadow-sm, and.shadow-lgare multi-stopbox-shadowdeclarations for a more natural falloff, plus new.shadow-xsand.shadow-xlsizes. New.shadow-{color}utilities (any theme color, plus.shadow-current,.shadow-black,.shadow-white) and.shadow-opacity-{10-100}utilities re-tint and scale shadows. Both set local, non-inheriting CSS variables (--bs-sc,--bs-so)—mirroring how.border-{color}utilities scope--bs-bc—so a shadow color or opacity override never leaks into nested.shadow-*elements. A global--bs-shadow-colorand--bs-shadow-strength(deepened automatically in dark mode) drive the default, uncolored look. See the Shadows docs for details. - New
.border-keylineutility. Added a.5pxkeylineoption to$border-widths(backed by a new--border-width-keylinecustom property) for hairline borders on high-density displays.
New components and plugins
- Dialog — replaces Modal, built on the native
<dialog>element. See the Components section above for the full migration. - Stepper — new
.steppercomponent for multi-step workflows with.stepper-itemand.stepper-horizontalvariant. CSS-only. - Avatar — new
.avatarcomponent with sizes (.avatar-xsthrough.avatar-xl), status indicators (.avatar-status .status-online|offline|busy|away), subtle variant, and.avatar-stackfor grouped avatars. - Chip and Chip Input — new
.chipcomponent for tags/tokens and.chip-input[data-bs-chips]for interactive chip entry.ChipsJavaScript plugin with events:add.bs.chips,remove.bs.chips,change.bs.chips,select.bs.chips. - OTP Input — new
.otpcomponent for one-time password fields. Built on a single<input>rendered as separate digit slots for full accessibility.OtpInputJavaScript plugin with events:input.bs.otpInput,complete.bs.otpInput(both exposeevent.value). - Password Strength —
StrengthJavaScript plugin for password strength metering withstrengthChange.bs.strengthevent. - Range —
RangeJavaScript plugin that turns.form-rangeinto a styled slider with a filled track, optional value bubble, and<datalist>tick marks, with achanged.bs.rangeevent. - Toggler —
TogglerJavaScript plugin for toggling classes or attributes on elements viadata-bs-toggle="toggler", withtoggle.bs.togglerandtoggled.bs.togglerevents. - Datepicker —
DatepickerJavaScript plugin built on Vanilla Calendar Pro. Popup datepickers close after selection, on outside interaction, on <kbd>Escape</kbd>, or when focus moves outside. Events:change.bs.datepicker,show.bs.datepicker,shown.bs.datepicker,hide.bs.datepicker,hidden.bs.datepicker. - Form Adorn — new
.form-adorncomponent for adding icons or text decoration to form inputs. - Prose — new
.proseclass for rich typography scoping and.not-proseto opt out of prose styles within a prose container. - NavOverflow — Wrap a
.navin<div class="nav-overflow" data-bs-toggle="nav-overflow">to collapse overflowing items into a menu. The plugin measures and observes the wrapper, and firesupdate.bs.navoverflowandoverflow.bs.navoverflowthere. See the Nav overflow docs. - Submenu — nested menu support via
.submenuclass within Menu, withsubmenuTrigger(hover,click, orboth) andsubmenuDelayoptions.
Docs
- Removed all
AddedInbadges. - Rearranged utilities documentation to break apart larger pages that included groups of utilities. Sizing, spacing, flex, type, and more have been broken out into smaller pages with new sub-group headings in the sidebar.
