What the list starts with
The page opens holding six rows, the Standard scale from dropdown 10 to tooltip 60, under a counter reading "6 layers". Every row has its own number box and a Remove button. A name field and a box defaulting to 10 feed Add, which trims the name, writes "layer" when it is blank, coerces anything non-numeric to 0 and then advances the box by ten.
A worked example
Add Modal backdrop at 30 and the counter reads 7 layers. The right panel places overlay backdrop and modal backdrop at rows 3 and 4, both printed as z-index: 30, with an amber box naming the pair and warning that they will stack in source order. The variable block gains --z-modal-backdrop: 30;. A row at 9999 brings the oversized-value note, a negative row the parent-background note.
How the panels and the output work
The stacking panel sorts a copy ascending on every keystroke, numbers the rows 1 to n and deepens each tint from an alpha of 0.75, so the frontmost row requests 1.20 and the browser clamps it. The read-only box holds one :root rule carrying --z-name: value; per layer in stack order, where names are lower-cased, runs outside a-z and 0-9 become a single hyphen, and a name with no Latin letters collapses to --z-layer. Flex and grid children open their own contexts, shown by the flexbox generator, and the specificity checker covers the rest.
Where it stops
- Nothing is read from your project, so an existing stylesheet has to be typed in by hand.
- Values pass through
parseInt, so auto or 1.5 arrive as 0 or a truncated integer. - The notes cover ties, 9999 and above, and negatives only; duplicate names are resolved in the variable block with a numeric suffix such as --z-modal-2.
- Presets overwrite the list and Sort by value rewrites row order, with no undo for either.
- A reload restores the Standard scale, because the list lives in a page variable.
Questions people ask
Does a bigger number always win
No. A z-index competes only inside its own stacking context, so a modal at 9999 can fall behind a plain header.
Why do two rows share a value
Nothing is reserved, so ties are allowed, reported by name and broken by insertion order.
How many layers are normal
Fewer than ten, which is why both presets stop at six.