Skip to content
Back to skills

Chakra Theming

ASecurity

Темизация Chakra UI v3: createSystem, токены и semantic tokens, recipes и slot recipes, dark/light mode. Загружай ДО правки theme.ts, defineRecipe/defineSlotRecipe и когда textStyle перебивает соседний fontSize, слоты slotRecipes пропали после partial-override, typecheck сыплет TS2322 на layerStyles, SSR падает на «extendWith is not a function», hydration mismatch из-за разных классов emotion.

  • 5 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 20, 2026
developmenttypescriptbashreactnextjs

Works with

  • cli

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned October 20, 2026

npx -y skills add kamiletar/letar --skill chakra-theming --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Chakra Theming?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Chakra Theming
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kamiletar-chakra-theming/badge)](https://www.skillsdirectory.com/skills/kamiletar-chakra-theming)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: chakra-theming
description: |
  Темизация Chakra UI v3: createSystem, токены и semantic tokens, recipes и slot recipes, dark/light mode. Загружай ДО правки theme.ts, defineRecipe/defineSlotRecipe и когда textStyle перебивает соседний fontSize, слоты slotRecipes пропали после partial-override, typecheck сыплет TS2322 на layerStyles, SSR падает на «extendWith is not a function», hydration mismatch из-за разных классов emotion.
---

# Chakra UI Theming Skill

## ⚠️ Ловушки (разборы в доках)

- [chakra-recipe-variant-property-override](/.claude/docs/chakra-recipe-variant-property-override.md) — `textStyle` перебивает соседний `fontSize`, `_hover` варианта мимо `base._hover`
- [chakra-slot-recipe-array-merge-truncation](/.claude/docs/chakra-slot-recipe-array-merge-truncation.md) — `slots` мержатся по индексу: короткий массив вычёркивает `root`
- [chakra-layer-style-property-allowlist](/.claude/docs/chakra-layer-style-property-allowlist.md) — TS2322 на `touchAction`/`transitionDuration` в layerStyle
- [chakra-multi-system-ssr-barrel-trap](/.claude/docs/chakra-multi-system-ssr-barrel-trap.md) — импорт из барреля с `createSystem()` в Server Component роняет SSR
- [chakra-css-memo-prop-order-hydration](/.claude/docs/chakra-css-memo-prop-order-hydration.md) — разные классы emotion на сервере и клиенте
- [chakra-strict-tokens-global-typegen](/.claude/docs/chakra-strict-tokens-global-typegen.md) — `strictTokens` ломает typecheck всех приложений

## Quick Reference

### Создание темы

```typescript
import { createSystem, defaultConfig, defineConfig } from '@chakra-ui/react'

const customConfig = defineConfig({
  theme: {
    tokens: {/* ... */},
    semanticTokens: {/* ... */},
    recipes: {/* ... */},
    slotRecipes: {/* ... */},
  },
})

export const system = createSystem(defaultConfig, customConfig)
```

### Основные семантические токены

```typescript
semanticTokens: {
  colors: {
    bg: {
      DEFAULT: { value: { _light: 'white', _dark: '{colors.gray.950}' } },
      subtle: { value: { _light: '{colors.gray.50}', _dark: '{colors.gray.900}' } },
      muted: { value: { _light: '{colors.gray.100}', _dark: '{colors.gray.800}' } },
    },
    fg: {
      DEFAULT: { value: { _light: '{colors.gray.900}', _dark: 'white' } },
      muted: { value: { _light: '{colors.gray.600}', _dark: '{colors.gray.400}' } },
    },
    border: {
      DEFAULT: { value: { _light: '{colors.gray.200}', _dark: '{colors.gray.800}' } },
    },
  },
}
```

### ColorModeProvider (Next.js)

```tsx
// app/layout.tsx
import { ThemeProvider } from 'next-themes'
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
  <ChakraProvider value={system}>{children}</ChakraProvider>
</ThemeProvider>
```

### Визуальная обратная связь (\_active)

Эталон: `apps/driving-school/src/theme/` — полная система `_active` стилей для всех компонентов.

```typescript
// Recipes (defineRecipe)
button:     { _active: { transform: 'scale(0.95)' } }  // + size variants: xs=0.9, lg=0.97
link:       { _active: { transform: 'scale(0.9)' } }
iconButton: { _active: { transform: 'scale(0.85)' } }  // + size variants

// Slot Recipes (defineSlotRecipe)
tabs:         { trigger:      { _active: { transform: 'scale(0.95)' } } }
accordion:    { itemTrigger:  { _active: { bg: 'bg.subtle', transform: 'scale(0.99)' } } }
menu:         { item:         { _active: { bg: 'bg.muted', transform: 'scale(0.98)' } } }
segmentGroup: { item:         { _active: { transform: 'scale(0.98)' } } }
checkbox:     { control:      { _active: { transform: 'scale(0.9)' } } }
radio:        { control:      { _active: { transform: 'scale(0.9)' } } }
slider:       { thumb:        { _active: { transform: 'scale(1.1)' } } }  // Увеличение!
tag:          { closeTrigger: { _active: { transform: 'scale(0.85)' } } }

// Layer Styles
'card.interactive': { _active: { transform: 'scale(0.99)' } }
'card.selectable':  { _active: { transform: 'scale(0.98)' } }
```

**Правила:**

- `transition: 'all 0.15s ease-out'` — обязателен (без него резкий эффект)
- `_disabled: { _active: { transform: 'none' } }` — отключай для disabled
- Slider thumb — единственный элемент с **увеличением** (1.1)

Подробнее: [visual-feedback.md](reference/visual-feedback.md)

## Справочные файлы

| Файл                                                             | Описание                               |
| ---------------------------------------------------------------- | -------------------------------------- |
| [overview.md](reference/overview.md)                             | Архитектура темизации                  |
| [tokens.md](reference/tokens.md)                                 | Design tokens (colors, spacing, sizes) |
| [semantic-tokens.md](reference/semantic-tokens.md)               | Семантические токены, \_light/\_dark   |
| [recipes.md](reference/recipes.md)                               | Recipes для компонентов                |
| [slot-recipes.md](reference/slot-recipes.md)                     | Slot Recipes                           |
| [dark-mode.md](reference/dark-mode.md)                           | Dark/Light mode                        |
| [contrast-accessibility.md](reference/contrast-accessibility.md) | WCAG контраст                          |
| [haptic-feedback.md](reference/haptic-feedback.md)               | Тактильная обратная связь              |
| [visual-feedback.md](reference/visual-feedback.md)               | Визуальная обратная связь              |
| [text-layer-styles.md](reference/text-layer-styles.md)           | Text и Layer Styles                    |
| [animations.md](reference/animations.md)                         | Анимации и переходы                    |
| [customization.md](reference/customization.md)                   | Conditions, CSS vars, utilities        |

## Генерация типов

```bash
npx @chakra-ui/cli typegen ./src/theme/index.ts
```

## Примеры тем в проекте Letar

- `apps/driving-school/src/theme/` — полная система визуальной обратной связи
- `apps/mandala/src/app/theme.ts` — семантические токены

Files in this skill

  • SKILL.md6.6 KB
  • reference/animations.md7.9 KB
  • reference/contrast-accessibility.md8.5 KB
  • reference/customization.md10.1 KB
  • reference/dark-mode.md5.6 KB
  • reference/haptic-feedback.md8.8 KB
  • reference/overview.md4.5 KB
  • reference/recipes.md7.7 KB
  • reference/semantic-tokens.md7.9 KB
  • reference/slot-recipes.md7.6 KB
  • reference/text-layer-styles.md8.1 KB
  • reference/tokens.md9.6 KB
  • reference/visual-feedback.md10.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.