Migration·续5

The helper .link-underline is no longer needed in v6.

  • Display utilities: added flow-root and contents options.
  • Sizing utilities:
  • Renamed .mh-*/.mw-* to .max-h-*/.max-w-*
  • Added .min-h-* and .min-w-* utilities with two default values, 0 and 100%
  • Added auto, min-content, max-content, and fit-content to width and height utilities.
  • New dynamic viewport utilities. .dvh-100 and .min-dvh-100 set height: 100dvh and min-height: 100dvh. .dvw-100 and .min-dvw-100 set width: 100dvw and min-width: 100dvw. The browser updates a dv* unit when it expands or retracts a browser interface. Use .dvh-100 for full-screen mobile layouts, because the section no longer overflows while a mobile browser shows its URL bar. Note that dvw does not fix the 100vw scrollbar 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-100 utilities are unchanged. Add svh, lvh, svw, and lvw utilities yourself with the utilities API — see Height and Width.
  • New color-scheme utilities. .color-scheme-light, .color-scheme-dark, and .color-scheme-auto set the color-scheme property 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 sets color-scheme on the page and on every iframe for you, so you need these utilities only for a single element — see the Reboot section above.
  • Flex & Grid utilities:
  • Added .place-items and .justify-items utilities.
  • Added .grid-cols-* utilities for grid-template-columns (1–4 and 6 column layouts), .grid-cols-fill for spanning all columns, .grid-cols-subgrid for adopting a parent grid's column tracks, and .grid-auto-flow utility.
  • Container query utilities. New .contains-inline and .contains-size utilities for container-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:class prefix pattern (e.g., hover:opacity-50 instead of opacity-50-hover), matching the responsive prefix convention.
  • Utility API cleanup. Removed css-var, css-variable-name, and local-vars options from the utility API. Use the property map approach for CSS custom properties and variables for static CSS custom properties within utility classes.
  • Shadows are now layered and themeable. .shadow, .shadow-sm, and .shadow-lg are multi-stop box-shadow declarations for a more natural falloff, plus new .shadow-xs and .shadow-xl sizes. 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-color and --bs-shadow-strength (deepened automatically in dark mode) drive the default, uncolored look. See the Shadows docs for details.
  • New .border-keyline utility. Added a .5px keyline option to $border-widths (backed by a new --border-width-keyline custom 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 .stepper component for multi-step workflows with .stepper-item and .stepper-horizontal variant. CSS-only.
  • Avatar — new .avatar component with sizes (.avatar-xs through .avatar-xl), status indicators (.avatar-status .status-online|offline|busy|away), subtle variant, and .avatar-stack for grouped avatars.
  • Chip and Chip Input — new .chip component for tags/tokens and .chip-input[data-bs-chips] for interactive chip entry. Chips JavaScript plugin with events: add.bs.chips, remove.bs.chips, change.bs.chips, select.bs.chips.
  • OTP Input — new .otp component for one-time password fields. Built on a single <input> rendered as separate digit slots for full accessibility. OtpInput JavaScript plugin with events: input.bs.otpInput, complete.bs.otpInput (both expose event.value).
  • Password Strength — Strength JavaScript plugin for password strength metering with strengthChange.bs.strength event.
  • Range — Range JavaScript plugin that turns .form-range into a styled slider with a filled track, optional value bubble, and <datalist> tick marks, with a changed.bs.range event.
  • Toggler — Toggler JavaScript plugin for toggling classes or attributes on elements via data-bs-toggle="toggler", with toggle.bs.toggler and toggled.bs.toggler events.
  • Datepicker — Datepicker JavaScript 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-adorn component for adding icons or text decoration to form inputs.
  • Prose — new .prose class for rich typography scoping and .not-prose to opt out of prose styles within a prose container.
  • NavOverflow — Wrap a .nav in <div class="nav-overflow" data-bs-toggle="nav-overflow"> to collapse overflowing items into a menu. The plugin measures and observes the wrapper, and fires update.bs.navoverflow and overflow.bs.navoverflow there. See the Nav overflow docs.
  • Submenu — nested menu support via .submenu class within Menu, with submenuTrigger (hover, click, or both) and submenuDelay options.

Docs

  • Removed all AddedIn badges.
  • 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.