Elevation Layer Map
Decide once what covers what, so overlays stop appearing behind the page.
What it adds
A documented ordering of the app's overlay layers — sticky chrome, menus, popovers, dialogs, notifications — and the rules for how they interact.
What your agent is told to do
5
What your agent is told to do
5-
1
List every element in the app that can overlap something else: sticky headers, bottom navigation, drawers, dropdown menus, popovers, tooltips, dialogs, toasts, and the command palette. Order them by what must always win when two are on screen together.
-
2
Write down the interaction rules alongside the order, not just the order itself: which layers may open while another is open, which dismiss the layer below, and which trap focus. An ordering without those rules only fixes the paint, not the behaviour.
-
3
Handle nesting explicitly. A popover opened from inside a dialog must render above that dialog, and closing the dialog must close it, so nested overlays need to know the layer of their opener rather than assuming a global value.
-
4
Decide how each layer interacts with persistent navigation. A drawer that slides under a fixed sidebar and a toast that lands beneath the mobile tab bar are both the same unspecified overlap, and both need an answer written down.
-
5
The numeric values themselves belong to Z-Index Registry; this feature owns the ordering and the behaviour, that one owns the tokens and enforcement. Do not define a second set of numbers here.
Edge cases it handles
7
Edge cases it handles
7- Any ancestor with a transform, filter, opacity below one, or a containment property creates a local stacking context, and a child inside it cannot escape upward no matter how high its value goes. Those ancestors have to be found and either removed or the overlay rendered outside them.
- Nested overlays — a menu inside a popover inside a dialog — must stack in the order they were opened and unwind in reverse, or dismissing the outer one strands the inner one on screen with no way to close it.
- Persistent navigation is the most common collision. Toasts landing under a mobile tab bar, drawers sliding beneath a fixed sidebar, and sticky action bars fighting a cookie banner all need a stated winner for the edge they share.
- Overlays rendered into a portal at the end of the document leave the DOM order, so keyboard focus and screen reader order must be restored deliberately rather than left to the browser.
- Fullscreen modes, whether the app's own focus layout or the browser's native fullscreen, change what the top layer even is. Anything that must remain reachable in fullscreen has to be rendered inside the fullscreen element.
- Native top-layer elements such as dialogs and popovers ignore the ordering entirely and always paint above everything, which will surprise anyone assuming the map governs all layers.
- Two toasts and a dialog opening in the same frame must not race — the ordering has to be deterministic regardless of which mounted first.
Definition of done
8
Definition of done
8- There is a single written ordering covering every overlapping surface in the app.
- Each layer's rules state what it may open over, what it dismisses, and whether it traps focus.
- A popover opened from within a dialog renders above it and closes with it.
- No overlay is clipped or hidden by a local stacking context.
- Every collision with persistent navigation has a documented winner.
- Numeric values come from Z-Index Registry rather than being redefined here.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Z-Index Registry
Z-Index Registry
Keep every stacking value in one file so nobody has to guess a bigger number.
What it does
A single source of named z-index tokens, with reserved ranges per layer and a check that blocks raw values.
How it works
- 1 Find every z-index in the codebase, including inline styles and values buried in third-party overrides, and list them with the component that owns each. The count is usually higher than anyone expects and several will be arbitrary large numbers.
- 2 Reserve a range for each layer rather than assigning single values, so a new dropdown can slot between existing ones without renumbering everything above it. Leave real gaps between ranges.
- 3 Name each token after the layer it belongs to and derive the ordering from Elevation Layer Map. That feature decides what covers what; this one holds the numbers and stops them being invented locally.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/z-index-registry
Shadow Scale
Shadow Scale
Replace ad hoc shadows with a small set tied to what each surface actually is.
What it does
A fixed ladder of shadow tokens, each named for an elevation role rather than a blur radius.
How it works
- 1 Collect every shadow currently declared anywhere in the app and group them by what they sit on — a resting card, a hovered card, a dropdown, a dialog, a toast. Most apps have a dozen near-identical values that collapse into four or five roles.
- 2 Name each step for its role, not its appearance. A token called menu tells the next person which surfaces may use it; a token called shadow-md-2 does not.
- 3 Use a single light source for the whole scale, so offset, blur, and spread grow together as elevation rises. Two shadows lit from different directions on the same screen read as a rendering bug.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/shadow-scale
Spacing Scale
Spacing Scale
Reduce the app's spacing to a small set of steps that repeat across every surface.
What it does
A named spacing scale covering gaps, padding, and section rhythm, with every existing value in the app mapped onto it.
How it works
- 1 Collect every spacing value currently in the codebase and count how often each appears. The result is usually a handful of genuine intentions surrounded by dozens of near-misses that were nudged once and never revisited.
- 2 Define a scale that is fine at the small end, where control padding lives, and coarse at the large end, where section separation lives. A linear scale gives too many indistinguishable large steps and too few small ones.
- 3 Separate the tokens used inside a component from the ones used between components and between page sections, and name them so the difference is obvious. The same number serving both purposes means a change to button padding also changes the gap between sections.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/spacing-scale
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.