К основному содержанию
скилл CX Codex

elevation-and-depth — скилл для Claude Code: что делает и установка

Задаёт правила для теней, скруглений и глубины интерфейса в CSS. Помогает агенту правильно оформлять карточки, модальные окна, выпадающие списки и тултипы.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add dembrandt/dembrandt-skills --skill elevation-and-depth -a claude-code
Открыть на GitHub

Что делает elevation-and-depth

Скилл вводит 6 уровней теней от --shadow-none до --shadow-xl, привязанных к конкретным ролям: от строк таблиц до командных палитр. Он запрещает тяжёлые тёмные тени. Светлую тень белых карточек скилл требует сочетать с рамкой в 1px, тон которой в 1.5–2 раза темнее тени. Это избавляет карточки от размытых границ.

Внутри прописаны правила для скруглений и подсветки. Для всех кнопок в продукте задаётся единый радиус через --radius-button, чтобы не ломать визуальную систему. При смене фона карточки на hover скилл требует обязательную границу или тень: заливка без контура выглядит оторванным пятном. Для text-shadow установлен предел прозрачности 0.30 и размытие до 4px.

Скилл не исправляет нечитаемые цвета. Сначала нужно поправить контраст палитры, и только потом накладывать text-shadow.

Какие задачи решает

  • настроить шкалу токенов для теней и слоёв
  • устранить размытые границы у белых карточек
  • унифицировать скругления для всех кнопок в проекте
  • оформить модальные окна и дропдауны с физической глубиной

Примеры запросов агенту

  • Настрой токены теней для карточек и модальных окон в Tailwind
  • Сделай так, чтобы эта белая карточка выделялась над фоном и не размывалась
  • Какой радиус скругления и тень применить к выпадающему списку?

Как установить elevation-and-depth

1Через Skills CLI (Vercel)

npx skills add dembrandt/dembrandt-skills --skill elevation-and-depth -a claude-code

2Вручную: положить файлы

~/.claude/skills/elevation-and-depth/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/elevation-and-depth/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора34

loading-states-and-perceived-performance Скилл для ИИ-кодинга, который помогает выбрать спиннер, скелетон или прогресс-бар и сделать интерфейс быстрее на ощупь. CX Codex +1 871установок generate-ui-from-brand Превращает URL сайта или файл DESIGN.md в дизайн-токены, решения по UX и готовую спецификацию интерфейса. CX Codex +1 870установок micro-interactions Скилл для мелких осмысленных анимаций: переключатели, иконки, моменты успеха. Пригодится, когда интерфейсу не хватает отклика. CX Codex +1 869установок status-colors-and-errors Скилл задаёт правила для семантических цветов статусов и текстов ошибок: сколько цветов держать, что каждый значит и как написать сообщение с выходом из ситуации. CX Codex +1 859установок sticky-and-fixed-elements Помогает решить, что остаётся на экране при прокрутке: липкие заголовки, нижние панели, плавающие кнопки, закреплённые шапки таблиц. CX Codex +1 855установок data-display-and-selection Помогает агенту проектировать таблицы, списки и сетки: режимы просмотра, массовые действия, сортировка, поиск и выбор строк. CX Codex +1 855установок notifications-and-recovery Скилл для проектирования уведомлений и состояний ошибок: тосты, инлайн-ошибки, баннеры и пути восстановления. Пригодится, когда нужно продумать фидбек после действия. CX Codex +1 854установок ui-context-and-scope Скилл задаёт правила ориентации пользователя в сложных интерфейсах: хлебные крошки, границы секций и баннеры имперсонации. Помогает проектировать глубокую навигацию. CX Codex +1 842установок

Похожие

design-system claudekit Скилл собирает дизайн-токены, спецификации компонентов и презентационные слайды. Подойдёт, когда интерфейс и слайды должны следовать одной системе. CX Codex +1 42 700установок brand claudekit Скилл держит голос бренда, визуальные правила и дизайн-токены в одном файле, а потом раздаёт их промптам агента и вашему CSS. CX Codex +1 39 900установок better-colors jakubkrehel Скилл проверяет палитры и строит систему цветовых токенов. Он нужен, когда в коде накопились случайные hex-значения, а контраст текста никто не считал. CX Codex +1 32 600установок stitch::extract-design-md официальный google-labs-code Извлекает дизайн-систему в файл DESIGN.md прямо из исходников фронтенда без сборки проекта. Помогает перенести визуальные токены и правила вёрстки в формат Stitch. CX Codex +1 10 600установок design-tokens julianoczkowski Генерирует файл дизайн-токенов — CSS-переменные или конфиг Tailwind — по выбранной эстетике, со светлой и тёмной темами. CX Codex +1 5 900установок tailwind-patterns davila7 Скилл для Claude, который задаёт агенту правила Tailwind CSS v4: конфигурация в CSS, контейнерные запросы, архитектура токенов. Пригодится тем, кто пишет интерфейс на утилитах. 2 720установок

Рядом в теме «Дизайн»

Всё по теме «Дизайн» →

Вопросы о elevation-and-depth

Как установить elevation-and-depth в Claude Code?

Выполните команду npx skills add dembrandt/dembrandt-skills --skill elevation-and-depth -a claude-code в терминале вашего проекта.

Что делает скилл elevation-and-depth?

Он добавляет в контекст агента дизайн-правила для работы со слоями, шестью уровнями теней, скруглениями и текстовыми тенями в стилях компонентов.

Разрешает ли скилл разные скругления для кнопок?

Нет, скилл прямо запрещает задавать разный border-radius для разных вариантов кнопок. Все кнопки в интерфейсе должны ссылаться на единый токен --radius-button.

Исходный текст

SKILL.md · MIT
---
name: elevation-and-depth
description: Shadows and layering that lift elements above the surface. Use when designing cards, dropdowns, modals, tooltips or any floating element.
metadata:
  priority: 6
  pathPatterns:
    - "**/*.css"
    - "**/*.scss"
    - "**/tokens/**"
    - "**/theme/**"
    - "tailwind.config.*"
    - "design-system/**"
    - "components/**"
  promptSignals:
    phrases:
      - "shadow"
      - "elevation"
      - "card"
      - "border radius"
      - "depth"
      - "floating"
      - "modal"
      - "dropdown"
retrieval:
  aliases:
    - elevation
    - box shadow
    - card design
    - depth hierarchy
    - border radius
    - floating elements
  intents:
    - make a card stand out
    - design elevation system
    - set up shadow tokens
    - make hierarchy feel physical
    - style a modal or dropdown
  examples:
    - make this card feel elevated
    - set up a shadow scale for the design system
    - what border radius should cards use
---

# Elevation and Depth

Elevation uses shadow and layering to communicate that an element sits above the base surface — giving UI a sense of physical depth. Combined with border-radius, it creates the tactile quality that makes cards graspable, modals clearly floating, and dropdowns feel like they've appeared on top of content.

## The Elevation Scale

Define a small set of elevation levels as tokens. Each level maps to a specific UI role.

| Level | Token | Shadow | Role |
|---|---|---|---|
| 0 | `--shadow-none` | none | Flat surface, inline elements |
| 1 | `--shadow-xs` | `0 1px 2px rgba(0,0,0,0.06)` | Subtle card, table row hover |
| 2 | `--shadow-sm` | `0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06)` | Card, input focus ring area |
| 3 | `--shadow-md` | `0 4px 6px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06)` | Dropdown, popover |
| 4 | `--shadow-lg` | `0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05)` | Modal, dialog, side drawer |
| 5 | `--shadow-xl` | `0 20px 25px rgba(0,0,0,0.08), 0 8px 10px rgba(0,0,0,0.04)` | Command palette, full-screen overlay |

Keep shadows subtle. Dark, heavy shadows feel dated and visually aggressive. Light, diffuse shadows feel modern and material.

### The "Shadow + Border" Rule
A subtle shadow on a white surface can sometimes "wash out," making the edge of a card feel fuzzy or indistinct.
- **Rule:** For elevated white cards or sections, pair the shadow with a **1px border** that is slightly darker (1.5x to 2x) than the shadow's core tone (e.g., a medium grey like `#E2E8F0` or `grey-200`).
- **Effect:** The border defines the physical boundary of the card, while the shadow provides the depth. Together, they make the component "pop" with much higher clarity than using either alone.

### Hover Needs a Defined Edge
A card that shifts **background colour on hover** must have a defined edge — a border, shadow, or clear radius boundary. Without one, the shift has no shape and reads as a stray fill, not a highlighted card. **On a borderless, flat card, a background-change hover is forbidden** — use a border or a shadow (elevation) on hover instead.

### Subtle Gradients for Depth
Gradients can be used to bring "liveliness" to an interface and reinforce the sense of elevation.
- **The Lighting Metaphor:** A subtle linear gradient (top-to-bottom) that is slightly lighter at the top mimics natural overhead lighting. This makes a surface feel more physical and elevated than a flat fill.
- **The 5% Rule:** Keep the gradient extremely subtle. A change in lightness of only 2–5% between the top and bottom is usually enough. If the user can easily see where the gradient starts and ends, it is likely too heavy.
- **Usage:** Apply to primary buttons, hero cards, and header sections to improve visual hierarchy and brand personality.

## Pairing Elevation with Border-Radius

Border-radius and shadow work together to define the character of a surface. The combination signals the element's role and the product's visual tone.

| Surface | Shadow | Border-Radius | Tone |
|---|---|---|---|
| Inline chip / tag | none | `--radius-full` (pill) | Flat, lightweight |
| Card | `--shadow-sm` | `--radius-md` (8–12px) | Graspable, contained |
| Dropdown / popover | `--shadow-md` | `--radius-md` (8px) | Floating, contextual |
| Modal / dialog | `--shadow-lg` | `--radius-lg` (12–16px) | Prominent, focused |
| Toast / notification | `--shadow-md` | `--radius-md` | Ephemeral, above content |
| Button | none or `--shadow-xs` | **consistent across all buttons** — see below |

### A Thick Accent Border and a Radius Never Share an Edge

Do not run a heavy coloured border along one side of a rounded box. Borders miter: where the accent meets its neighbours the renderer cuts a diagonal seam, and the radius bends that seam into a curve, so the accent visibly narrows and peels away before the corner ends. A 4px edge on an 8px radius spends most of its length tapering. Give the accent its own filled element instead, a bar or a wash that the container's radius clips cleanly, or keep the box square where the accent runs. A fill has no miter and no taper.

## Border-Radius Consistency Rule

**Button border-radius must not vary within a product.** All buttons — primary, secondary, destructive, ghost — use the same radius token. Varying radius between button types breaks visual consistency and implies a semantic difference that does not exist.

```css
/* Correct: one radius for all buttons */
.btn { border-radius: var(--radius-button); }

/* Wrong: different radii for different button variants */
.btn-primary { border-radius: 8px; }
.btn-secondary { border-radius: 4px; }  /* ← breaks consistency */
```

The button radius token is a brand decision — set it once, apply it everywhere.

## Text Shadow for Contrast and Separation

`text-shadow` can lift text off a background without changing colours — useful when contrast is marginal or text sits on a photograph, gradient, or complex background.

The effect must be imperceptible as a shadow. If the user notices the shadow, it is too strong.

```css
/* On images or complex backgrounds */
.hero-title {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Very subtle separation from a near-matching background */
.label-on-tinted-surface {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* White text on light background — use a dark shadow, not white */
.inverted-text {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.30);
}
```

**Rules:**
- Opacity: stay below `0.30` — above that it reads as a design choice rather than a refinement
- Blur: `2–4px` maximum — higher values make text feel dirty
- Offset: `0 1px` or `0 0` — directional offsets above 2px look like retro Web 2.0
- Never use `text-shadow` to compensate for a contrast failure — fix the colour first. Use it only when colours are already close to passing and a nudge is needed, or when text sits on unpredictable imagery

## Dark Mode Shadows

Shadows are less visible on dark backgrounds. On dark surfaces, compensate with:
- Slightly higher opacity on shadow values
- Adding a subtle border (`1px solid rgba(255,255,255,0.08)`) to define card edges
- Increasing the elevation level by one step for the same perceived depth

## Review Checklist

- [ ] Is there a defined elevation scale as design tokens (not one-off shadow values per component)?
- [ ] Does each elevated element use the correct level for its role (card ≠ modal)?
- [ ] Are shadows light and diffuse, avoiding heavy black (#000) defaults?
- [ ] For white cards on light backgrounds, is the shadow paired with a 1px border for better definition?
- [ ] Is border-radius consistent across all button variants?
- [ ] Do shadows feel subtle and diffuse rather than heavy and dark?
- [ ] On dark surfaces, are card/panel edges visible through border or adjusted shadow?
- [ ] Is elevation used to communicate layering — not just decoration?
- [ ] If gradients are used, are they subtle (2–5% lightness change) and used to reinforce the lighting/elevation metaphor?

## Common Anti-Patterns

| Anti-pattern | Problem | Fix |
|---|---|---|
| Different border-radius on primary vs secondary buttons | Implies semantic difference that doesn't exist | Single `--radius-button` token for all buttons |
| Heavy `box-shadow: 0 8px 16px rgba(0,0,0,0.4)` | Feels dated and visually aggressive | Use low-opacity, multi-layer diffuse shadows |
| Shadow on every element regardless of role | Elevation loses meaning when everything is elevated | Reserve shadow for genuinely floating elements |
| Flat cards with no elevation on a white background | Card edge disappears into the page | Use `--shadow-sm` or a `1px` border to define the card boundary |

© dembrandt · MIT · dembrandt/dembrandt-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой