anywhere-ui
Design system rules, token discipline, geometry, typography, controls, content copywriting, TanStack Query guardrails, ViewTransition motion, and shadcn registry usage for Anywhere Labs web consoles and admin dashboards.
SKILL.md 原文预览
Anywhere UI Design System
Use this skill whenever creating or modifying web interfaces styled with Anywhere UI (Next.js + Tailwind CSS v4 + Base UI + shadcn). Full human-readable specification: docs/design-system.md (中文) / docs/design-system.en.md (English).
1. Visual Philosophy & Surface Hierarchy
Anywhere UI is a calm, monochrome, dark-first console aesthetic (dark is the default theme; light is a full first-class sibling):
- Never hard-code hex colors in
.tsxfiles. Always use semantic CSS variable utilities (bg-background,bg-card,bg-surface-raised,bg-surface-hover,bg-secondary,bg-popover,text-foreground,text-foreground-secondary,text-muted-foreground,border-border,border-border-strong). - Dark palette:
- Canvas
--background:#000000(pure black) - Borderless card
--card:#141414 - Raised surface / popover / sidebar active
--surface-raised/--popover/--sidebar-accent:#191919 - Hover surface
--surface-hover/--accent:#252525 - Secondary pill / active tile
--secondary:#262626 - Wireframe border
--border-strong:#303030 - Light palette:
- Canvas
--background:oklch(1 0 0)(#ffffff) - Borderless card
--card:#f3f3f3 - Raised surface
--surface-raised:#ececec - Secondary / hover
--secondary/--surface-hover:#e4e4e4 - Sidebar canvas
--sidebar:oklch(0.985 0 0) - Sidebar active pill
--sidebar-accent:oklch(0.92 0 0)(keeps clear contrast on#fafafasidebar) - Borderless surfaces:
- Cards (
rounded-card bg-card), theme selection tiles (rounded-2xl bg-card), nested value panels (rounded-xl bg-backgroundinsidebg-card), and user avatars (UserAvatar) are borderless — separated by tonal steps, never heavy borders. - Standalone icons are borderless: never wrap a lone status/empty-state/hero icon inside a gray circular or square container (
rounded-full bg-surface-raised). Render the icon cleanly atsize-6–size-8 stroke-[1.5] text-muted-foreground(ortext-destructive/text-success). - Icon-only action buttons (pagination arrows, table row actions, copy button, mobile drawer trigger) use
variant="ghost"(size="icon-sm"orsize="icon-xs"), never boxed outlines.
2. Typography (Mixed Latin + CJK)
- English / Latin / digits: keep the native system stack —
"SF Pro Text"/"SF Pro Display"on Apple,"Segoe UI"on Windows. - Chinese (Simplified Chinese / CJK punctuation): use self-hosted variable HarmonyOS Sans SC (
@luzixu/harmonyos-sans, variable weight40 900), loaded viaapp/harmonyos-sans-sc.csscontaining only the CJK/punctuation WOFF2 subsets (sc-*) and omitting the Latinfont-text-*slice. - Place
"HarmonyOS Sans SC"before"SF Pro Text"/-apple-systemin--font-sansand--font-display: - ASCII/Latin glyphs do not match
"HarmonyOS Sans SC"'sunicode-range, so English falls straight through to native SF Pro / Segoe UI (and pure English pages download 0 bytes of CJK fonts). - Chinese glyphs match
"HarmonyOS Sans SC"immediately, preventing macOS-apple-systemfrom intercepting CJK with PingFang SC. - Monospace discipline (
font-mono): reserve strictly for operator/developer identifiers (admin claim keys, client IDs, slugs, callback URIs, JSON editors,CopyableValue). Usetabular-numsfor all quotas, counts, pagination indices, and timestamps.
3. Two-Tier Corner Geometry (corner-shape)
- Base radius scale:
--radius: 0.75rem(12px),--radius-card-max: 32px,--radius-card: min(var(--radius-4xl), var(--radius-card-max))(~31.2px). - Under
@supports (corner-shape: superellipse(1.35)):
- Multi-line rounded rectangles (cards, dialogs, popovers, multi-item menus, textareas, tiles, card skeletons) use
corner-shape: superellipse(1.35)(subtle G2-continuous smoothing — never boxysquircle/superellipse(2)). - Circles & capsules/pills (
[class*="rounded-full"],button,input, single-lineinput-group,badge,switch,switch-thumb,sidebar-menu-button, pilltabs-list/tabs-trigger,user-avatar,avatar,radio-group-*) MUST remain strictlycorner-shape: round. Symmetricsuperellipse(K > 1)flattens vertical capsule end-caps into rounded rectangles. - **Never write
[class*="-full"]** in CSS selectors — it accidentally matchesw-fullandh-full. Always write[class*="rounded-full"].
Skeletondefaults torounded-card(override torounded-fullfor single-line text/button skeletons androunded-2xlfor table row skeletons).
4. Controls & Information Display Patterns
- Pill Buttons (
components/ui/button.tsx): - Two primary visual hierarchies:
- Emphasized:
variant="default"(bg-foreground text-background) — solid high-contrast pill for the single primary action. - Non-emphasized wireframe:
variant="outline"(border-border-strong bg-transparent text-foreground hover:bg-surface-raised) — calm pill for secondary actions and quick-filter chips. - Optical pill padding:
sm=h-8 px-4,default=h-9 px-4,lg=h-10 px-5, matchingInput(h-9 px-4) andBadge(h-5 px-2.5). - Use
nativeButton={false}whenever passingrender={<Link ... />}to Base UIButton. - Pill-in-Pill Switch (
components/ui/switch.tsx, adapted from shadcnbase-luma): 44×20track (h-5 w-11) with24×16pill thumb (h-4 w-6, checked translatetranslate-x-[calc(100%-8px)]).- Checked/unchecked contrast on pure black dark canvas: checked track
bg-foreground, checked thumbbg-background dark:bg-secondary; unchecked trackbg-input dark:bg-surface-raised, unchecke
评论
