0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2026-11-16 06:58:43 +00:00
bootstrap/js/tests/visual
Mark Otto 6bfd67014c
Finish the CSS-first transition model (#42816)
* Document the v6 transition model

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.

* Give dialog, drawer, menu, and toast a transition-property token

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.

* Move alert, tab, tooltip, and popover off the shared .fade class

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.

* Animate collapse with interpolate-size instead of JavaScript

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.

* Drop the stale .hide callout from the toast docs

v6 removed the deprecated class, so the note about keeping it for
backwards compatibility no longer applies.

* Stop the horizontal collapse demo from shifting the page

The wrapper reserved 120px, but the open card measures 138px in the docs,
so the content below it jumped on open.

* Reserve the same height in the collapse visual fixture
History 2026-08-11 11:06:32 -07:00
..
alert.html Finish the CSS-first transition model (#42816) 2026-08-11 11:06:32 -07:00
button.html Fix visual JavaScript tests to load bootstrap.bundle.js as a module (#42531) 2026-06-20 08:58:27 +02:00
carousel.html Fix visual JavaScript tests to load bootstrap.bundle.js as a module (#42531) 2026-06-20 08:58:27 +02:00
collapse.html Finish the CSS-first transition model (#42816) 2026-08-11 11:06:32 -07:00
datepicker.html Docs: remove deprecated .bg-light 2026-07-23 19:37:30 +02:00
dialog.html Docs: remove or replaced deprecated .text-bg-dark with .fg-white 2026-07-22 21:57:58 +02:00
floating-label.html Floating labels: place label before control for screen readers (#42539) 2026-06-23 10:27:23 -07:00
input.html Fix visual JavaScript tests to load bootstrap.bundle.js as a module (#42531) 2026-06-20 08:58:27 +02:00
menu-submenu.html Migrate navbar examples/tests from collapse to drawer and remove deprecated .navbar-collapse 2026-07-27 23:10:53 -07:00
menu.html Migrate navbar examples/tests from collapse to drawer and remove deprecated .navbar-collapse 2026-07-27 23:10:53 -07:00
popover.html Fix JavaScript visual tests using bootstrap instance (#42562) 2026-06-25 22:11:43 +02:00
scrollspy.html Migrate navbar examples/tests from collapse to drawer and remove deprecated .navbar-collapse 2026-07-27 23:10:53 -07:00
tab.html Finish the CSS-first transition model (#42816) 2026-08-11 11:06:32 -07:00
toast.html Fix JavaScript visual tests using bootstrap instance (#42562) 2026-06-25 22:11:43 +02:00
tooltip.html Fix JavaScript visual tests using bootstrap instance (#42562) 2026-06-25 22:11:43 +02:00