01What is Z-Index Manager?
Most stylesheets that have lived for a few years end up with z-index values like 9999 and 10001, and nobody remembers why. This manager gives you one place to name your layers, give each a number, and see the order before you write any CSS. It opens with a modal system preset: base content at 0, a sticky header at 100, a dropdown at 200, an overlay at 900, the modal at 1000, a toast at 1100 and a tooltip at 1200. Each layer has a name, a z-index and a color swatch. The Layers panel always lists them from top to bottom, so editing a number moves the row straight away. Add Layer creates a "New Layer" 100 above your current highest value. Values are clamped to the signed 32-bit range that browsers accept, from -2147483648 to 2147483647. The Visual Stack panel draws a bar per layer, scaled between the lowest and highest values, with the z value printed beside it. The Generated CSS Variables block is the part you take away. It sorts layers from lowest to highest and writes a :root block of custom properties, then one usage rule per layer. Names are lowercased and any run of characters other than a to z and 0 to 9 becomes a single hyphen. So "Overlay/Backdrop" at 900 turns into --z-overlay-backdrop: 900 plus .overlay-backdrop { z-index: var(--z-overlay-backdrop); }. A name that starts with a digit gets a layer- prefix, because a CSS class can't start with one. An empty name becomes layer- plus its position in the sorted list. A second layer called Tooltip comes out as tooltip-2 rather than quietly clashing with the first. Under the CSS there's a short panel on why a huge number can still lose. z-index only compares elements inside the same stacking context. MDN's stacking context guide lists what creates a new one, including opacity below 1, transform, filter, isolation: isolate, position: fixed or sticky, and container-type. The panel also reminds you that z-index does nothing on a static element unless it's a flex or grid item. Be clear about what this is. It plans one stacking context, usually the page root. It doesn't read your DOM, so it can't tell you why a real dropdown is hidden. Your layer list also lives only in the open tab. There's no save, so copy the CSS before you reload.
Front-end developers and design system maintainers use it to turn a pile of magic z-index numbers into one named, ordered scale of CSS variables. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Z-Index Manager
- Pick a preset from the examples (Modal system, App layout or Tooltip + dropdown), or keep the default modal list
- Rename layers and type new z-index values in the Layers (top to bottom) panel
- Click Add Layer for a new level 100 above the highest, and use the trash icon to drop layers you don't need
- Check the Visual Stack panel to confirm the order looks right
- Click Copy CSS to copy the :root variables and usage rules, or the reset icon to go back to the modal preset
03Worked examples
- Input:
Layers: Modal 1000, Base 0, 2nd Modal 1001 - Result:
:root { --z-base: 0; --z-modal: 1000; --z-layer-2nd-modal: 1001; } … .base { z-index: var(--z-base); } .modal { z-index: var(--z-modal); } .layer-2nd-modal { z-index: var(--z-layer-2nd-modal); } - Variables are sorted low to high. A name starting with a digit gets a layer- prefix because a class name can't start with a digit. The … stands for the usage comment.
- Input:
Layers: Tooltip 50, Tooltip 60, (empty name) -1 - Result:
:root { --z-layer-1: -1; --z-tooltip: 50; --z-tooltip-2: 60; } - Duplicate names get -2, -3 suffixes, and an empty name becomes layer- plus its position in the sorted list. Usage rules trimmed.
- Input:
Layers: Overlay/Backdrop 900, Toast 1100 - Result:
:root { --z-overlay-backdrop: 900; --z-toast: 1100; } … .overlay-backdrop { z-index: var(--z-overlay-backdrop); } .toast { z-index: var(--z-toast); } - The slash is replaced with a hyphen, so the token stays a valid identifier.
- Input:
Preset: App layout (Background -1, Content 0, Sidebar 10, Header 50, Floating action 100) - Result:
:root { --z-background: -1; --z-content: 0; --z-sidebar: 10; --z-header: 50; --z-floating-action: 100; } - Spaces become hyphens. The real output continues with the usage comment and one class per layer.
04Common use cases
- Replacing scattered 999 and 9999 values in a legacy stylesheet with a short list of named --z- tokens
- Agreeing on the order of modals, toasts and tooltips before building them in a component library
- Adding a z-index scale to a design system's token docs, with the generated CSS as the reference
- Working out where a new cookie banner should sit relative to an existing sticky header and modal
- Setting up z-index custom properties at the start of a new React, Vue or Svelte project
- Showing a teammate why their z-index: 10000 tooltip still renders under a transformed card
05Tips
- Leave gaps of 100 between layers. Add Layer already does this, and it lets you slot something in later without renumbering everything.
- Keep layer names short and distinct. Slashes and spaces become hyphens, and a repeated name gets a -2 suffix, which is valid but hard to read.
- Put isolation: isolate on component roots. Their internal z-index values then can't fight with your page-level tokens.
- If a high value still loses, look up the tree for transform, opacity below 1 or filter on an ancestor. That ancestor has started its own stacking context.
06Related concepts
z-index, stacking context, CSS custom properties, design tokens, layering.
Frequently Asked Questions
What is Z-Index Manager?
Z-Index Manager is a free, browser-based developer tool on AIDToolStack. Visualize and organize z-index layers It requires no installation or sign-up and works entirely in your browser.
Is Z-Index Manager free to use?
Yes. No sign-up, no fees and no usage cap.
Does Z-Index Manager store my data?
No. It runs in your browser; nothing is uploaded.