Skip to content

bestdeejay-design/agent-skills / skills/mobile-frontend

mobile-frontend

Verified

Composite skill for quality mobile-first frontend — codified rules (spacing, type scale, anchors, safe-area, tap-targets), build, and multi-level verification with per-element menu/nav debugging.

FileKindSize
SKILL.mdskill md10.3 KB
readme.ru.mdmarkdown1.8 KB
references/debug-menu-nav.mdmarkdown4.8 KB
references/mobile-checklist.mdmarkdown3.5 KB
references/tokens.mdmarkdown3.3 KB
skill.jsonconfig1.9 KB

references/tokens.md

View on GitHub
# Мобильные токены (Mobile Foundations)

Единый источник правды по числам для мобильной вёрстки. Все значения — CSS-переменные
в `:root`. Вне токенов допустимы только `transparent` и `currentColor`.

## Spacing (4/8-сетка, pt → px: 1pt ≈ 1.333px)

```css
:root{
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;   /* базовый отступ секции */
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;   /* крупные секции / 40pt-зона */
  --space-8: 48px;

  --content-px: 20px;        /* боковые поля контента на телефоне */
  --content-max: 720px;      /* верхняя граница контейнера (планшет) */
  --header-h: 56px;          /* высота sticky-шапки */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}
```

## Type scale (clamp = мобильный→десктоп)

```css
:root{
  --fs-body: 16px;            /* НЕ меньше 16px — иначе iOS зумит при фокусе input */
  --fs-small: 14px;
  --fs-h1: clamp(28px, 8vw, 44px);
  --fs-h2: clamp(22px, 6vw, 32px);
  --fs-h3: clamp(18px, 4.5vw, 24px);
  --lh-body: 1.5;
  --lh-tight: 1.2;
}
body{ font-size: var(--fs-body); line-height: var(--lh-body); }
h1{ font-size: var(--fs-h1); line-height: var(--lh-tight); }
```

## Breakpoints (mobile-first: min-width)

```css
--bp-sm: 480px;   /* крупные телефоны / ландшафт */
--bp-md: 768px;   /* планшет */
--bp-lg: 1024px;  /* десктоп */
```
Базовые стили = мобильные. Расширения только через `@media (min-width: ...)`.

## Якоря под фиксированной шапкой

```css
:root{ --header-h: 56px; }
html{ scroll-behavior: smooth; }
section[id], [id]{ scroll-margin-top: calc(var(--header-h) + 16px); }
```
Проверка: `element.getBoundingClientRect().top >= headerBottom - 1` после скролла.

## Safe-area (чёлка / home indicator)

```html
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
```
```css
:root{
  --sat: env(safe-area-inset-top);
  --sar: env(safe-area-inset-right);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);
}
.header{ padding-top: calc(var(--space-4) + var(--sat)); }
.tabbar{ padding-bottom: calc(var(--space-3) + var(--sab)); }
```

## Tap-target

```css
/* любая интерактивная цель — минимум 44×44 */
a, button{ min-height: 44px; min-width: 44px; }
.icon-btn{ width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
```

## Motion

```css
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
```

## Цвета (пример, замените под бренд)

```css
:root{
  --bg: #0F172A;
  --surface: #1E293B;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --primary: #2563EB;
  --primary-contrast: #FFFFFF;
  --border: rgba(255,255,255,0.10);
}
/* контраст: --text на --bg ≥ 4.5:1; --primary-contrast на --primary ≥ 4.5:1 */
```
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies 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 colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall