Skip to content

Commit

Permalink
docs(utilities): add 'Z-index' page (#2669)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Déramond <[email protected]>
  • Loading branch information
louismaximepiton and julien-deramond authored Aug 7, 2024
1 parent 1d011d2 commit 3c49d70
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
42 changes: 41 additions & 1 deletion site/content/docs/0.0/utilities/z-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,44 @@ group: utilities
toc: true
---

{{< callout-soon "page" >}}
## Example

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-3 position-absolute p-5"><span>z-3</span></div>
<div class="z-2 position-absolute p-5"><span>z-2</span></div>
<div class="z-1 position-absolute p-5"><span>z-1</span></div>
<div class="z-0 position-absolute p-5"><span>z-0</span></div>
<div class="z-n1 position-absolute p-5"><span>z-n1</span></div>
{{< /example >}}

<!--## Overlays
OUDS Web 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 maps

Customize this Sass map to change the available values and generated utilities.

{{< scss-docs name="zindex-levels-map" file="scss/_variables.scss" >}}

### Sass utilities API

Position utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]({{< docsref "/utilities/api#using-the-api" >}})

{{< scss-docs name="utils-zindex" file="scss/_utilities.scss" >}}
1 change: 0 additions & 1 deletion site/data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@
- title: Vertical align
- title: Visibility
- title: Z-index
draft: true

- title: Extend
icon: tools
Expand Down

0 comments on commit 3c49d70

Please sign in to comment.