css-stacking-contexts

Audit CSS stacking contexts and generate prioritized remediation plans for z-index issues.

2|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/coastdigitalgroup/coastai-skills --skill css-stacking-contexts
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: css-stacking-contexts
Source: https://github.com/coastdigitalgroup/coastai-skills/tree/main/website-development/css-stacking-contexts
Command: npx skills add https://github.com/coastdigitalgroup/coastai-skills --skill css-stacking-contexts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Systematically identify and diagnose CSS stacking context issues caused by z-index, opacity, transforms, and related properties, enabling predictable UI layering.

Core Features & Use Cases

  • Stacking Audit: trace stacking contexts to determine which elements create or inherit contexts.
  • Remediation Plans: propose minimal, robust strategies to fix layering conflicts (e.g., adjusting z-index, using isolation, or restructuring DOM).
  • Use Case: repair a tooltip trapped behind a header by isolating its parent or elevating the parent stacking context.

Quick Start

Audit the page's stacking contexts and generate a prioritized remediation plan to fix z-index layering.

Frequently Asked Questions about css-stacking-contexts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why is my z-index not working on overlapping UI elements?▼

Your z-index is likely not working because a parent element created a new stacking context via properties like transform, opacity, or isolation. Analyzing element positioning and stacking context inheritance resolves these unpredictable UI layering conflicts.

What CSS properties create a new stacking context?▼

CSS properties that create a new stacking context include z-index with a positioned element, opacity values less than 1, transforms, and isolation. Auditing these properties helps diagnose why overlays, sticky headers, and tooltips are trapped behind other elements.

How do I fix a modal or tooltip trapped behind a sticky header?▼

Fix a trapped modal or tooltip by adjusting z-index relationships, applying isolation to isolate its parent, or restructuring the DOM hierarchy. Generating a prioritized remediation plan ensures minimal, robust strategies for repairing complex layered components.

What is the best way to audit complex stacking contexts in web development?▼

The best way to audit complex stacking contexts is systematically tracing which elements create or inherit contexts through their CSS properties. This process produces a clear layering map and validation checks to resolve UI conflicts across web projects.

Does using opacity or transform affect my element's z-index layering?▼

Using opacity or transform directly affects z-index layering because both properties create a new stacking context. This confines child elements within the parent's layering limits, requiring a structured audit to restructure DOM and fix overlay visibility.

When should I use the CSS isolation property for UI layering?▼

Use the CSS isolation property when you need to create a new stacking context without relying on transforms or opacity. It isolates a parent element's layering, preventing child components like tooltips and modals from conflicting with external z-index values.