diff options
| author | Mark Otto <[email protected]> | 2022-10-22 17:13:39 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-10-22 17:13:39 -0400 |
| commit | 0968db80997613828634ddb4b2c3980871f0ed41 (patch) | |
| tree | 385a5a0161d0537ad1f81e679c39a1288fc64d8d /site/content/docs | |
| parent | bbe1ffdb680eba550604df167ec32bf1505ca8e1 (diff) | |
| download | bootstrap-0968db80997613828634ddb4b2c3980871f0ed41.tar.xz bootstrap-0968db80997613828634ddb4b2c3980871f0ed41.zip | |
Add `z-index` utilities, `.z-*` (#37317)
* Add z-index utilities, .z-*
* Fix missing comma in _utilities.scss
* Fix bundlewatch
* Fix lint
* Update site/content/docs/5.2/utilities/z-index.md
Co-authored-by: Julien Déramond <[email protected]>
* custom appearance
* linter
Co-authored-by: Julien Déramond <[email protected]>
Co-authored-by: Julien Déramond <[email protected]>
Diffstat (limited to 'site/content/docs')
| -rw-r--r-- | site/content/docs/5.2/utilities/z-index.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/site/content/docs/5.2/utilities/z-index.md b/site/content/docs/5.2/utilities/z-index.md new file mode 100644 index 000000000..afd667474 --- /dev/null +++ b/site/content/docs/5.2/utilities/z-index.md @@ -0,0 +1,46 @@ +--- +layout: docs +title: Z-index +description: Use our low-level `z-index` utilities to quickly change the stack level of an element or component. +group: utilities +toc: true +--- + +## Example + +{{< added-in "5.3.0" >}} + +Use `z-index` utilities to stack elements on top of one another. Requires a `position` value other than `static`, which can be set with custom styles or using our [position utilities]({{< docsref "/utilities/position/" >}}). + +{{< callout >}} +We call these "low-level" `z-index` utilities because of their default values of `-1` through `3`, which we use for the layout of overlapping components. High-level `z-index` values are used for overlay components like modals and tooltips. +{{< /callout >}} + +{{< example class="bd-example-zindex-levels position-relative" >}} +<div class="z-n1 position-absolute p-5 rounded-3"></div> +<div class="z-0 position-absolute p-5 rounded-3"></div> +<div class="z-1 position-absolute p-5 rounded-3"></div> +<div class="z-2 position-absolute p-5 rounded-3"></div> +<div class="z-3 position-absolute p-5 rounded-3"></div> +{{< /example >}} + +## Overlays + +Bootstrap overlay components—dropdown, modal, offcanvas, popover, toast, and tooltip—all have their own `z-index` values to ensure a usable experience with competing "layers" of an interface. + +Read about them in the [`z-index` layout page]({{< docsref "/layout/z-index" >}}). + +## Component approach + +On some components, we use our low-level `z-index` values to manage repeating elements that overlap one another (like buttons in a button group or items in a list group). + +Learn about our [`z-index` approach]({{< docsref "/extend/approach#z-index-scales" >}}). + +## CSS + +### Sass map + +Customize this Sass map to change the available values and generated utilities. + +{{< scss-docs name="zindex-levels-map" file="scss/_variables.scss" >}} + |
