]> git.ipfire.org Git - thirdparty/bootstrap.git/commit
Refine Stepper component (#42165)
authorpricop <pricop.info@gmail.com>
Wed, 18 Mar 2026 02:26:23 +0000 (04:26 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Mar 2026 02:26:23 +0000 (19:26 -0700)
commite867fcfaac2d0364dad0afa192b574abe805a45f
tree16f0165bd970182488f93ef4c256ce517393cf8f
parentce3149b70157178ee99ce5fc4da5fc4b5654ff57
Refine Stepper component (#42165)

* Add stepper font size variable to tokens map

Since the `--stepper-size` container is customizable, it makes sense for the `font-size` to be as well, when using larger sizes, larger font size may also be required.

This also changes the default `font-size` to `-sm` size for the counter inside the bubble.

This is the perfect example where if we use the `-sm` variant, it makes the text feel more relaxed inside the bubble.

* Reduce stepper track size from 0.25rem to 0.125rem

This further relaxes the component by taking away the attention from the track itself, allowing bubbles and text to be more easily readable at a glance without feeling overcrowded.

 The industry standard is 1px or 2px at max.

As a result, the stepper tracker has been reduced to down to `2px`  from `4px`

For reference:
- Tailwind UI practices `2px` width: https://tailwindcss.com/plus/ui-blocks/application-ui/navigation/progress-bars#component-4b1efed043d1ab5688c705f2e27524f3
- Material UI practices `1px` width: https://material.angular.dev/components/stepper/overview
- Preline UI practices `1px` width: https://preline.co/docs/stepper.html
- Flowbite UI practices `1px` width: https://flowbite.com/docs/components/stepper/
- ReUI practices `1px` width: https://reui.io/patterns/stepper

* Add align-items start to horizontal stepper

This will make the text to always start at the top, regardless of whether other bubbles have a multi-line text or not.

* Fixed horizontal stepper text gap & text overflow

Fixes the horizontal bottom row being fixed in height, causing the spacing between the count bubble and the text not be the same as intended (as the gap dictates), nor as its vertical stepper counterpart.

This also fixes the text overflowing outside fixed boundaries, causing it to move in places it shouldn't be.

* Refactor to use logical properties

Fixed RTL mode by making use of logical properties instead of physical ones.

* Colored the right side stepper line

Colored the right side stepper line instead of the left side for active elements.

This is the natural way, if I reached the next step, then the edge leading to it should be colored in the color of the completed step.

* Fixed stepper width not account for stepper's gap

Fixed stepper width not account for stepper's gap

* Added complex stepper support for vertical steppers

- Added complex stepper support for vertical steppers.
- Added --stepper-text-gap CSS var (customizable spacing between text & bubble)
- Fixed text overflow for vertical steppers when the text is too long

* Restored 1fr for the rows template

Restored 1fr for the rows template. While I believed it looked better before, I'd rather keep the row size across all steps.

* tweaks

* make container query instead, add new utility to make container queries easier

* Remove stepper playground

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
scss/_stepper.scss
scss/_utilities.scss
site/src/components/shortcodes/StepperPlayground.astro [deleted file]
site/src/content/docs/components/stepper.mdx