Skip to content

Commit

Permalink
z-index page (#4553)
Browse files Browse the repository at this point in the history
Co-authored-by: Tayyaba Taimur <[email protected]>
Co-authored-by: Josh Wooding <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent d40c435 commit ef0631d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Shadow
layout: DetailTechnical
sidebar:
groupLabel: Elevation
priority: 4
---

Expand Down Expand Up @@ -70,4 +71,4 @@ A scrim is a complimentary darkened or lightened surface that obscures the backg
alt="Diagram showing a scrim on an interface."
/>

:fragment{src="./fragments/feedback.mdx"}
:fragment{src="../fragments/feedback.mdx"}
32 changes: 32 additions & 0 deletions site/docs/foundations/elevation/z-index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Z-Index
layout: DetailTechnical
sidebar:
priority: 4
---

Z-index is a CSS property that controls how elements stack on top of each other. The stack order is defined by an element with a higher z-index appearing on top of an element with a lower z-index.

Z-index and shadow are used together to help distinguish each layer in the stack. Shadow provides the visual element and z-index provides the structural element. Please refer to the [shadow](/salt/foundations/shadow) foundation page if you're using z-index.

## Z-Index ramp

Salt provides z-index tokens that determine an item’s position in the layering order. By providing consistent z-indexes, the design system ensures a predictable hierarchy of visual elements when stacked on top of one another.

<Image
src="/img/foundations/z-index.png"
alt="Diagram showing a stack of elements to show how Z-index layers items."
/>

| Token | Value |
| ---------------------- | ----- |
| `-zIndex-default` | 1 |
| `-zIndex-appHeader` | 1000 |
| `-zIndex-drawer` | 1200 |
| `-zIndex-modal` | 1300 |
| `-zIndex-notification` | 1400 |
| `-zIndex-dragObject` | 1420 |
| `-zIndex-contextMenu` | 1450 |
| `-zIndex-flyover` | 1500 |

:fragment{src="../fragments/feedback.mdx"}
Binary file added site/public/img/foundations/z-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef0631d

Please sign in to comment.