AddThisFeature

CSS Debug Outlines

Outline every box on the page from one switch, without touching component code.

simple Developer Experience

What it adds

A single development-only stylesheet that outlines and labels elements across the whole interface from one toggle.

What your agent is told to do

5
  1. 1

    Implement the whole thing as one stylesheet activated by an attribute or class on the document root, so nothing has to be added to individual components and the switch can be flipped anywhere in the app.

  2. 2

    Use outlines, which are painted outside the box and take no space, rather than borders. Confirm the change by measuring a known element with the mode on and off.

  3. 3

    Vary the outline treatment by nesting depth so a deeply nested tree remains readable rather than collapsing into one grey mass of coincident lines.

  4. 4

    Allow the set of outlined elements to be narrowed by selector, so a developer chasing one region is not shown the entire document.

  5. 5

    Do not use this as the app's structural debugging tool. Labelled grid tracks, scroll containers, and component-level filtering belong to Layout Debug Mode; this feature is deliberately the crude, zero-dependency switch, and the two must not be active at once.

Edge cases it handles

7
  • Borders and any change to padding or box sizing move the layout and manufacture new bugs; only outlines, box shadows, or an overlay layer are acceptable.
  • Deeply nested markup produces overlapping outlines that read as a single thick line — cycle colour or opacity by depth so structure remains visible ten levels down.
  • Selector filtering must be genuinely scoped, so restricting to one region does not still paint its ancestors and every sibling on the way down.
  • The stylesheet must be excluded from production bundles entirely, not merely left inert behind an unset class. Verify against a built artefact.
  • Elements with their own outline or focus ring must not have it overwritten, or keyboard focus becomes invisible while the mode is on.
  • Replaced content such as images, canvases, and embedded frames will not show inner structure; outline the element itself and do not imply there is nothing inside.
  • The toggle state should survive a reload during a debugging session rather than being lost on every refresh.

Definition of done

8
  • One toggle outlines elements across the entire app with no per-component changes.
  • Measured element dimensions are identical with the mode on and off.
  • Nesting depth is distinguishable in the outline treatment.
  • Outlining can be narrowed to a selector or region.
  • Focus indicators remain visible while the mode is active.
  • The stylesheet is absent from the production bundle, verified in the built output.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 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.