Frontend layering specificity debug

From JinNing6/Noosphere · View interactive version

Frontend layering specificity debug is an AI agent skill from the GitHub repository JinNing6/Noosphere. Diagnose and fix frontend controls whose typography or dimensions ignore component CSS, and React Three Fiber/Drei projected HTML labels that paint above opaque drawers, dialogs, or navigation. Use for inconsistent button sizes, element-type-dependent styling, unexpected wrapping, z-index escalation

How to use this skill

Skill file

Frontend Layering And Specificity Debug

Diagnose Before Styling

  1. Reproduce at the reported viewport and interaction state.
  2. Record bounding boxes plus computed font-size, line-height, width, height, and z-index.
  3. Compare equivalent element types. A <button> and an <a> that share a component class but render differently usually indicate a selector or user-agent boundary.
  4. Enumerate matched CSS rules instead of inferring from source order alone.
  5. Use document.elementFromPoint() at the overlap to identify the element that actually paints or receives input.

Fix Typography Specificity

Fix Projected 3D Labels

Regression Checks

Run desktop, compressed desktop, and mobile checks:

const style = getComputedStyle(control)
expect(style.fontSize).toBe('13px')
expect(document.body.scrollWidth).toBe(document.documentElement.clientWidth)

For an open overlay, compare the projected label and drawer layers and probe overlap points:

const top = document.elementFromPoint(x, y)
expect(drawer.contains(top)).toBe(true)

Also verify:

Completion Standard

Complete only when the original viewport reproduces cleanly, computed styles prove the intended rule wins, projected labels stay below DOM overlays, responsive overflow is zero, and a regression check covers the root cause.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.