Skip to content

Finish the CSS-first transition model - #42816

Open
mdo wants to merge 7 commits into
v6-devfrom
mdo/css-first-transitions
Open

Finish the CSS-first transition model#42816
mdo wants to merge 7 commits into
v6-devfrom
mdo/css-first-transitions

Conversation

@mdo

@mdo mdo commented Aug 11, 2026

Copy link
Copy Markdown
Member
  • Documents the transition model — state classes, the token trio, and how to remove motion — as a Customize page
  • Adds --*-transition-property to dialog, drawer, menu, and toast, and fixes the accordion's hardcoded ::details-content timing
  • Moves alert, tab, tooltip, and popover off .fade. Each declares its own transition and tokens; .fade stays for author markup
  • Moves collapse to interpolate-size, dropping .collapsing and the JS size math
  • Component JS now reads the computed transition duration instead of looking for a class

Closes #28968

mdo added 7 commits August 10, 2026 15:32
Bootstrap now animates components in CSS and lets JavaScript toggle one
state class, but that rule only lived in the migration guide. Add a
Customize page that names the state classes, the token trio, and the four
ways to remove the motion, so component migrations have one contract to
follow.
These four components exposed a duration and an easing token but hard-coded
the property list, so a slide meant rewriting the whole declaration. Each one
now reads --{name}-transition-property, which also let the dialog and the
drawer drop their duplicate open-state transition: one list covers both
directions because visibility interpolates as a step that stays visible while
either end is.

The accordion panel gets the same trio, in place of a hard-coded .2s that
ignored the component tokens.
These four components animated through a generic .fade class that authors had
to remember, and they sequenced the animation from JavaScript. Each one now
declares its own transition and its own token trio in CSS, as the toast
already did, and animates by default:

- An alert fades out from a .hiding class, because an alert is visible in the
  markup with or without .show, so the absence of .show cannot mark the exit.
- A tab pane fades in from @starting-style. The plugin adds .active and .show
  in the same frame instead of waiting a transition between them. The outgoing
  pane still leaves at once, since two in-flow panes cannot cross-fade without
  one stacking under the other.
- A tooltip or popover fades in from @starting-style. `animation: false` now
  adds .tooltip-instant or .popover-instant, the same class an author can add.

The JavaScript reads the computed transition duration instead of looking for a
class, so .transition-none, an -instant class, reduced motion, and
$enable-transitions all resolve the promise at once.

.fade stays for author markup, and it is harmless where it remains, but no
component depends on it.
The plugin measured the content and wrote inline sizes to fake a height
animation. CSS can do it: `interpolate-size` interpolates `0` to the `auto`
of the open state, so the plugin only toggles `.show`. This drops the
`.collapsing` class and the size math, and matches the accordion.

Also raise the CSS bundlewatch ceilings for this transition series.
v6 removed the deprecated class, so the note about keeping it for
backwards compatibility no longer applies.
The wrapper reserved 120px, but the open card measures 138px in the docs,
so the content below it jumped on open.
@mdo
mdo requested a review from a team as a code owner August 11, 2026 00:19
@mdo
mdo requested a review from a team as a code owner August 11, 2026 00:19
@mdo mdo added this to v6.0.0 Aug 11, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant