z-index-scale
БесплатноБез исполняемых скриптовНе проверенGenerates systematic z-index tokens for layering management. Use when organizing stacking contexts, modal/dropdown z-index, tooltip layers, or fixing z-index…
Об этом скилле
Z-Index Scale
Overview
Generate a systematic z-index token scale that eliminates arbitrary values and z-index conflicts. Creates predictable layering for dropdowns, modals, tooltips, and overlays.
When to Use
- Setting up z-index tokens for a new design system
- Fixing z-index conflicts and "wars" in existing code
- Creating consistent layering for overlays, modals, tooltips
- Documenting stacking context expectations
Quick Reference: Layering Levels
| Level | Purpose | Typical Range |
|---|---|---|
| Base | Default content flow | 0 |
| Raised | Cards, subtle elevation | 1-10 |
| Dropdown | Menus, selects, popovers | 100-199 |
| Sticky | Sticky headers, sidebars | 200-299 |
| Fixed | Fixed navigation, FABs | 300-399 |
| Overlay | Backdrop, dimmer | 400-499 |
| Modal | Dialogs, sheets | 500-599 |
| Toast | Notifications, snackbars | 600-699 |
| Tooltip | Tooltips, hovers | 700-799 |
| Maximum | Debug overlays, dev tools | 9999 |
The Process
- Understand stacking needs: Identify all layered components in the system
- Ask output format: CSS custom properties, Tailwind config, or JSON tokens
- Generate scale: Create tokens with semantic naming
- Document usage: Explain which token for which use case
Output Formats
CSS Custom Properties
:root {
/* Base - default document flow */
--z-index-base: 0;
--z-index-below: -1;
/* Raised - subtle elevation within content */
--z-index-raised: 1;
--z-index-raised-2: 2;
--z-index-raised-3: 3;
/* Dropdown - menus, selects, comboboxes, popovers */
--z-index-dropdown: 100;
/* Sticky - sticky positioned elements */
--z-index-sticky: 200;
/* Fixed - fixed navigation, floating action buttons */
--z-index-fixed: 300;
--z-index-header: 310;
--z-index-sidebar: 320;
/* Overlay - backdrop behind modals */
--z-index-overlay: 400;
/* Modal - dialogs, sheets, drawers */
--z-index-modal: 500;
--z-index-modal-content: 510;
/* Toast - notifications, snackbars */
--z-index-toast: 600;
/* Tooltip - tooltips, title attributes */
--z-index-tooltip: 700;
/* Maximum - debug, dev tools (avoid in production) */
--z-index-max: 9999;
}
Tailwind Config
// tailwind.config.js
module.exports = {
theme: {
extend: {
zIndex: {
'below': '-1',
'base': '0',
'raised': '1',
'raised-2': '2',
'raised-3': '3',
'dropdown': '100',
'sticky': '200',
'fixed': '300',
'header': '310',
'sidebar': '320',
'overlay': '400',
'modal': '500',
'modal-content': '510',
'toast': '600',
'tooltip': '700',
'max': '9999',
},
},
},
};
Usage:
<div class="z-overlay">Backdrop</div>
<div class="z-modal">Modal content</div>
<div class="z-tooltip">Tooltip</div>
JSON Tokens (Design Tokens Format)
{
"z-index": {
"below": { "value": -1, "description": "Below base content" },
"base": { "value": 0, "description": "Default document flow" },
"raised": {
"1": { "value": 1, "description": "Subtle elevation" },
"2": { "value": 2, "description": "Medium elevation" },
"3": { "value": 3, "description": "High elevation" }
},
"dropdown": { "value": 100, "description": "Menus, selects, popovers" },
"sticky": { "value": 200, "description": "Sticky positioned elements" },
"fixed": {
"base": { "value": 300, "description": "Fixed elements" },
"header": { "value": 310, "description": "Fixed header" },
"sidebar": { "value": 320, "description": "Fixed sidebar" }
},
"overlay": { "value": 400, "description": "Backdrop behind modals" },
"modal": {
"base": { "value": 500, "description": "Modal container" },
"content": { "value": 510, "description": "Modal inner content" }
},
"toast": { "value": 600, "description": "Notifications, snackbars" },
"tooltip": { "value": 700, "description": "Tooltips" },
"max": { "value": 9999, "description": "Maximum (debug only)" }
}
}
Stacking Context Concepts
What Creates a New Stacking Context
Understanding stacking contexts prevents unexpected z-index behavior:
/* These properties create new stacking contexts */
.creates-context {
/* Any of these: */
position: relative; z-index: 1; /* positioned + z-index */
position: fixed; /* fixed positioning */
position: sticky; /* sticky positioning */
opacity: 0.99; /* opacity < 1 */
transform: translateZ(0); /* any transform */
filter: blur(0); /* any filter */
isolation: isolate; /* explicit isolation */
contain: layout; /* containment */
will-change: transform; /* will-change hint */
}
Isolation Pattern
Use isolation: isolate to contain z-index within a component:
/* Component
Установить z-index-scale в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл z-index-scale?
Generates systematic z-index tokens for layering management. Use when organizing stacking contexts, modal/dropdown z-index, tooltip layers, or fixing z-index conflicts. Outputs CSS, Tailwind, or JSON.
Как установить скилл z-index-scale?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл z-index-scale запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic