casper-design-system
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCasper Studios Design System
Casper Studios 设计系统
A clean, elevated SaaS design system built on shadcn/ui, Tailwind CSS v4, and React (Vite). Every interface generated for Casper Studios — whether a client demo, internal tool, or quick prototype — must follow these rules to maintain a consistent, professional visual identity across the team.
Before generating any UI code, read this file completely and the reference files listed below. You MUST read the reference files — they contain rules and code examples that are required for correct output. Skipping them will produce incorrect, off-brand UI.
Required for EVERY project:
- — ALWAYS read. Reusable pieces: stat cards, list items, filter bars, kanban boards, profile cards, product cards, activity feeds, toast notifications, form validation states. Required whenever building UI elements inside a layout.
references/components.md - — ALWAYS read. Tailwind CSS v4 theme tokens. Copy this file into your project as-is.
references/theme.css - — Contains Casper Studios logo SVGs in 4 variants (default, variant, mono-black, mono-white). Use the correct variant based on background color — see the Logo section below.
assets/
Required based on platform:
- — MUST read when the project is a web application. Web-specific responsive rules + code examples: app shell, sidebar nav, dashboard grid, data table page, page header.
references/web-layouts.md - — MUST read when the project is a mobile application. Mobile-specific rules + code examples: device frame, top bar, bottom tab navigation, form patterns, pinned-button layout, list views, card stacks, full screen compositions, contextual actions (menus + bottom sheets).
references/mobile.md
Non-negotiable: Do not generate UI without reading the platform reference file first. If you are unsure whether the project is web or mobile, ask the user before proceeding.
这是一个基于shadcn/ui、Tailwind CSS v4和**React (Vite)**构建的简洁高端的SaaS设计系统。为Casper Studios生成的所有界面——无论是客户演示、内部工具还是快速原型——都必须遵循这些规则,以在团队内保持一致、专业的视觉标识。
在生成任何UI代码之前,请完整阅读本文档以及下方列出的参考文件。你必须阅读参考文件——它们包含生成正确输出所需的规则和代码示例。跳过这些文件会生成不符合品牌规范的错误界面。
所有项目的必选内容:
- — 务必阅读。可复用组件:统计卡片、列表项、筛选栏、看板、个人资料卡片、产品卡片、活动流、提示通知、表单验证状态。在布局内构建UI元素时必须使用。
references/components.md - — 务必阅读。Tailwind CSS v4主题令牌。直接将此文件复制到你的项目中。
references/theme.css - — 包含4种变体的Casper Studios Logo SVG文件(默认版、变体版、单色黑色版、单色白色版)。根据背景颜色选择正确的变体——详见下方Logo章节。
assets/
基于平台的必选内容:
- — 当项目为Web应用时必须阅读。Web端专属响应式规则+代码示例:应用外壳、侧边栏导航、仪表盘网格、数据表页面、页面头部。
references/web-layouts.md - — 当项目为移动应用时必须阅读。移动端专属规则+代码示例:设备框架、顶部栏、底部标签导航、表单模式、固定按钮布局、列表视图、卡片堆叠、全屏布局、上下文操作(菜单+底部弹窗)。
references/mobile.md
硬性要求: 未阅读对应平台的参考文件,不得生成UI。若不确定项目是Web还是移动应用,请先询问用户。
Before You Generate: Required Context
生成前须知:必要上下文
Before producing any UI code, confirm the following with the user. If their prompt already answers these clearly, proceed without asking. If not, ask before generating anything.
- Platform — Is this a web application or a mobile application? (Determines which reference file to follow.)
- Dark mode — Should the interface support dark mode, or is it light mode only? (Determines whether to implement class overrides, use
.darkfor surfaces, and include the mono-white logo variant.)bg-neutral-0
Do NOT assume defaults for these. If the user says "build me a dashboard," you don't know if it's web or mobile, or if it needs dark mode. Ask.
在生成任何UI代码之前,请与用户确认以下内容。若用户的提示已明确回答这些问题,可直接进行;若未明确,请先询问。
- 平台 — 这是Web应用还是移动应用?(决定需遵循哪个参考文件。)
- 深色模式 — 界面是否需要支持深色模式,还是仅使用浅色模式?(决定是否实现类覆盖、使用
.dark作为表面背景,以及是否使用单色白色Logo变体。)bg-neutral-0
请勿假设默认值。若用户说“帮我做一个仪表盘”,你无法确定它是Web还是移动应用,也无法确定是否需要深色模式,必须询问。
Summary
概述
The Casper aesthetic is clean authority — a professional SaaS style that feels premium without trying too hard. It uses generous whitespace, a restrained purple accent, and soft rounded surfaces to create interfaces that feel trustworthy and modern. Think Linear meets Notion: structured, breathable, quietly confident.
Casper的美学风格是简洁权威——一种专业的SaaS风格,兼具高级感却不刻意。它使用充裕的留白、克制的紫色强调色和柔和的圆角表面,打造出值得信赖且现代的界面。可以理解为Linear与Notion的结合:结构化、透气、低调自信。
Core Principles
核心原则
- Whitespace is a feature. Generous padding, breathing room between sections. Never cram.
- One accent, used sparingly. Brand purple () appears on active states, primary buttons, and key CTAs — nowhere else. If everything is purple, nothing is.
#5900FF - Rounded but not bubbly. 10px default radius for cards (shadcn default). Buttons and inputs use 8px. Feels modern without feeling like a toy.
- Flat with depth hints. No heavy shadows. Use for cards,
shadow-smfor popovers. Never useshadow-mdon in-page elements.shadow-lg - Content over chrome. The UI should disappear. Users notice the data, not the design.
- 留白是特色。充裕的内边距、区块间的呼吸空间。绝不过度拥挤。
- 单一强调色,谨慎使用。品牌紫色()仅用于激活状态、主按钮和关键CTA——其他地方不得使用。若所有元素都是紫色,就没有重点了。
#5900FF - 圆角但不浮夸。卡片默认圆角为10px(shadcn默认值)。按钮和输入框使用8px圆角。既现代又不会显得幼稚。
- 扁平化但有层次暗示。不使用厚重阴影。卡片使用,弹出层使用
shadow-sm。页面内元素绝不能使用shadow-md。shadow-lg - 内容优先于装饰。UI应隐形。用户关注的是数据,而非设计。
Tech Stack
技术栈
- React (Vite) with TypeScript
- Tailwind CSS v4 — Use the theme file at as Casper brand overrides
references/theme.css - shadcn/ui — Initialize a standard shadcn/ui project first (), then layer Casper brand tokens from
shadcn initon top. The shadcn semantic layer (references/theme.css,bg-background,text-foreground,bg-primary, etc.) is the base — Casper's theme.css adds brand colors, typography, shadows, and spacing on top of it, not as a replacement. Use shadcn components directly. Do NOT create custom base components that duplicate shadcn functionalityborder-border - Lucide React — Icon library. Always use Lucide, never Heroicons or FontAwesome
- Fonts — with
DM Sansas fallback for all UI text. Load via Google Fonts or bundlesans-serif
- React (Vite) + TypeScript
- Tailwind CSS v4 — 使用中的主题文件作为Casper品牌覆盖配置。shadcn的语义层(
references/theme.css、bg-background、text-foreground、bg-primary等)是基础——Casper的theme.css在其之上添加品牌颜色、排版、阴影和间距配置,而非替换。直接使用shadcn组件,请勿创建重复shadcn功能的自定义基础组件。border-border - Lucide React — 图标库。务必使用Lucide,不得使用Heroicons或FontAwesome。
- 字体 — 所有UI文本使用,后备字体为
DM Sans。等宽字体(sans-serif)仅适用于代码块、数据标签和ID。font-mono
Color System
色彩系统
The palette is intentionally restrained. Most of the UI is neutral gray + white, with purple as a sharp accent.
调色板刻意保持克制。UI大部分为中性灰+白色,搭配紫色作为鲜明强调色。
Usage Rules
使用规则
| Role | Token | Hex | When to use |
|---|---|---|---|
| Brand accent | | | Active nav items, primary buttons, links, focus rings |
| Brand subtle | | | Active nav background, selected row highlight, hover tints |
| Brand light | | | Icon circle backgrounds, soft tag fills |
| Default text | | | Page titles, headings |
| Body text | | | Primary body text |
| Subtext | | | Metadata, timestamps, secondary labels |
| Borders | | | Card borders, dividers, table lines |
| Surface | | | Page background behind cards |
| Card surface | | | Card backgrounds, panels (use |
| 角色 | 令牌 | 十六进制值 | 使用场景 |
|---|---|---|---|
| 品牌强调色 | | | 激活的导航项、主按钮、链接、焦点环 |
| 品牌浅色调 | | | 激活的导航背景、选中行高亮、悬停色调 |
| 品牌淡色调 | | | 图标圆形背景、柔和标签填充 |
| 默认文本 | | | 页面标题、标题文本 |
| 正文文本 | | | 主要正文文本 |
| 辅助文本 | | | 元数据、时间戳、次要标签 |
| 边框 | | | 卡片边框、分隔线、表格线条 |
| 页面背景 | | | 卡片后方的页面背景 |
| 卡片背景 | | | 卡片背景、面板(为兼容深色模式,请使用 |
Semantic Colors
语义色彩
Use these ONLY for status indicators, badges, and contextual feedback — never as decorative accents.
- Success — (
success-500) for badges/icons,#22C55Efor pill backgroundssuccess-50 - Error — (
error-500) for badges/icons,#EF4444for pill backgroundserror-50 - Warning — (
warning-500) for badges/icons,#F59E0Bfor pill backgroundswarning-50
仅将这些颜色用于状态指示器、徽章和上下文反馈——切勿用作装饰性强调色。
- 成功 — (
success-500)用于徽章/图标,#22C55E用于胶囊背景success-50 - 错误 — (
error-500)用于徽章/图标,#EF4444用于胶囊背景error-50 - 警告 — (
warning-500)用于徽章/图标,#F59E0B用于胶囊背景warning-50
What NOT to do
禁止操作
- Do NOT use brand purple for backgrounds on large surfaces
- Do NOT use semantic colors decoratively
- Do NOT introduce new colors. If you need a new shade, use the neutral scale
- Do NOT use opacity-based colors when a token exists (e.g., don't do , use
text-black/50)neutral-500
- 不得将品牌紫色用于大面积背景
- 不得将语义色彩用于装饰
- 不得引入新颜色。若需要新色调,请使用中性色阶
- 已有对应令牌时,不得使用基于透明度的颜色(例如,请勿使用,应使用
text-black/50)neutral-500
Typography
排版
All text is set in DM Sans with sans-serif as fallback (). Monospace () is acceptable for code blocks, data labels, and IDs only.
font-family: 'DM Sans', sans-seriffont-mono所有文本均使用DM Sans,后备字体为()。等宽字体()仅适用于代码块、数据标签和ID。
sans-seriffont-family: 'DM Sans', sans-seriffont-monoScale
字号体系
| Style | Size | Weight | Line Height | Use |
|---|---|---|---|---|
| Heading 1 | 30px | 500 | 36px | Page titles only. One per view. |
| Heading 2 | 20px | 500 | 24px | Section titles within a page |
| Heading 3 | 16px | 500 | 20px | Card titles, subsection labels |
| Body | 14px | 400 | 20px | Default paragraph and UI text |
| Body Bold | 14px | 500 | 20px | Emphasis within body text, table headers |
| Caption | 12px | 400 | 16px | Timestamps, helper text, metadata |
| Caption Bold | 12px | 500 | 16px | Badge labels, small category tags |
| 样式 | 字号 | 字重 | 行高 | 使用场景 |
|---|---|---|---|---|
| 一级标题 | 30px | 500 | 36px | 仅用于页面标题。每个视图仅一个。 |
| 二级标题 | 20px | 500 | 24px | 页面内的区块标题 |
| 三级标题 | 16px | 500 | 20px | 卡片标题、子区块标签 |
| 正文 | 14px | 400 | 20px | 默认段落和UI文本 |
| 粗体正文 | 14px | 500 | 20px | 正文内强调内容、表格表头 |
| 说明文本 | 12px | 400 | 16px | 时间戳、辅助文本、元数据 |
| 粗体说明文本 | 12px | 500 | 16px | 徽章标签、小型分类标签 |
Rules
规则
- Headings are always weight (500), never bold (700)
medium - NEVER use all-caps except for tiny metadata labels (e.g., "STATUS", "OWNER" in table column headers) set at caption size
- Links use color with no underline by default, underline on hover
brand-500 - Do NOT vary font size beyond this scale. If something feels wrong, adjust spacing not font size
- 标题始终使用字重(500),绝不能使用粗体(700)
medium - 除了说明文本大小的极小元数据标签(例如,表格列标题中的“STATUS”、“OWNER”),绝不能使用全大写
- 链接默认使用颜色且无下划线,悬停时显示下划线
brand-500 - 不得超出此字号体系调整字体大小。若觉得不合适,请调整间距而非字号
Spacing & Layout
间距与布局
Spacing Scale
间距体系
Use Tailwind's default spacing scale. Key values:
- (p-1) — icon padding, tight gaps
4px - (p-2) — badge padding, small gaps
8px - (p-3) — input padding, card internal gaps
12px - (p-4) — card padding, section gaps
16px - (p-6) — between cards, content sections
24px - (p-8) — major section separation
32px - (p-12) — page-level padding on large screens
48px
使用Tailwind默认的间距体系。关键值:
- (p-1) — 图标内边距、紧凑间隙
4px - (p-2) — 徽章内边距、小间隙
8px - (p-3) — 输入框内边距、卡片内部间隙
12px - (p-4) — 卡片内边距、区块间隙
16px - (p-6) — 卡片之间、内容区块之间
24px - (p-8) — 主要区块分隔
32px - (p-12) — 大屏幕上的页面级内边距
48px
Layout Rules
布局规则
- Page background: (
neutral-50)#FAFAFA - Content is always organized inside Cards (white background, border, rounded)
- Maximum content width: centered
1280px - On pages with a sidebar, sidebar is fixed width
240px - Main content area uses remaining space with padding
24px
- 页面背景:(
neutral-50)#FAFAFA - 内容始终组织在卡片内(白色背景、边框、圆角)
- 内容最大宽度:,居中对齐
1280px - 带侧边栏的页面中,侧边栏宽度固定为
240px - 主内容区域使用剩余空间,内边距为
24px
Shadows & Elevation
阴影与层次
The design is predominantly flat. Shadows are used to indicate layers, not to add decoration.
| Token | Use |
|---|---|
| Cards, inputs at rest |
| Dropdown menus, popovers, tooltips |
| Modals, command palettes, overlays ONLY |
| Semantic alias for |
NEVER apply (or its alias ) to cards or in-page elements. These are reserved for floating layers only.
shadow-lgshadow-overlay设计以扁平化为主。阴影仅用于区分层级,而非装饰。
| 令牌 | 使用场景 |
|---|---|
| 卡片、静止状态的输入框 |
| 下拉菜单、弹出层、提示框 |
| 仅用于模态框、命令面板、覆盖层 |
| |
绝不能将(或其别名)应用于卡片或页面内元素。这些阴影仅保留给浮动层级使用。
shadow-lgshadow-overlayBorder Radius
圆角
The theme file () uses the shadcn/ui radius system — a single base variable in that controls the entire scale via . This is mapped into Tailwind classes via . No Tailwind v4 defaults are overridden.
references/theme.css--radius:rootcalc()@theme inline| Token | Tailwind Class | Default Value | Use |
|---|---|---|---|
| | 6px | Inner elements, nav items, small nested controls |
| | 8px | Buttons, inputs, popovers, tooltips, chart tooltips |
| | 10px | Cards, panels, large containers |
| | 14px | Modal containers, dialogs, hero cards |
| (Tailwind built-in) | | 9999px | Badges, pills, avatars, icon circles |
The base value (10px) is the shadcn default. To make the entire UI sharper or rounder, change this single value — all tokens recalculate automatically.
--radius: 0.625remCards always use (10px). Buttons and inputs always use (8px). Nested elements inside cards should use (6px) for non-interactive elements to maintain visual hierarchy — the inner radius should always be smaller than the outer.
rounded-lgrounded-mdrounded-sm主题文件()使用shadcn/ui的圆角体系——中的单个基础变量通过控制整个圆角体系。它通过映射到Tailwind类。未覆盖任何Tailwind v4默认值。
references/theme.css:root--radiuscalc()@theme inline| 令牌 | Tailwind类 | 默认值 | 使用场景 |
|---|---|---|---|
| | 6px | 内部元素、导航项、小型嵌套控件 |
| | 8px | 按钮、输入框、弹出层、提示框、图表提示框 |
| | 10px | 卡片、面板、大型容器 |
| | 14px | 模态框容器、对话框、英雄卡片 |
| (Tailwind内置) | | 9999px | 徽章、胶囊、头像、图标圆形 |
基础值(10px)是shadcn的默认值。若要让整个UI更锐利或更圆润,只需修改这个单一值——所有令牌会自动重新计算。
--radius: 0.625rem卡片始终使用(10px)。按钮和输入框始终使用(8px)。卡片内的嵌套元素对于非交互元素应使用(6px),以保持视觉层级——内部圆角必须小于外部圆角。
rounded-lgrounded-mdrounded-smIconography
图标规范
- Use Lucide React exclusively. Import as:
import { IconName } from "lucide-react" - Default icon size: for inline,
16pxfor standalone20px - Icon color follows its text context (e.g., for subtext,
neutral-500for active)brand-500 - For icons inside circular backgrounds (common in lists and dashboards):
- Circle: diameter,
40pxorbrand-50background,brand-100rounded-full - Icon: ,
20pxcolorbrand-500 - For semantic contexts, swap to the matching semantic color pair (e.g., bg +
error-50icon)error-500
- Circle:
- 仅使用Lucide React。导入方式:
import { IconName } from "lucide-react" - 默认图标大小:行内图标为,独立图标为
16px20px - 图标颜色与其所在文本上下文一致(例如,辅助文本使用,激活状态使用
neutral-500)brand-500 - 对于列表和仪表盘中常见的圆形背景内的图标:
- 圆形:直径,背景为
40px或brand-50,brand-100rounded-full - 图标:,颜色为
20pxbrand-500 - 语义化场景下,替换为匹配的语义色彩组合(例如,背景 +
error-50图标)error-500
- 圆形:直径
Casper Studios Logo
Casper Studios Logo规范
The Casper Studios logo has four variants stored in . Use the correct variant based on the background it sits on:
assets/| Variant | File | When to use |
|---|---|---|
| Default (full color) | | Light/white backgrounds. Gradient icon + purple "CASPER" + dark "STUDIOS". This is the primary logo — use it whenever possible. |
| Variant (full color) | | Light/white backgrounds when you want all-black text instead of purple + dark gray. Same gradient icon. |
| Mono Black | | Light backgrounds where color is unavailable (e.g., print, grayscale contexts). Grayscale icon + near-black text. |
| Mono White | | Dark backgrounds only. Gray icon + white text. Use this whenever the logo sits on a dark surface (dark nav bars, dark hero sections, overlays, dark mode). |
Casper Studios Logo在中有四种变体。根据其所在的背景选择正确的变体:
assets/| 变体 | 文件 | 使用场景 |
|---|---|---|
| 默认(全彩) | | 浅色/白色背景。渐变图标 + 紫色“CASPER” + 深灰色“STUDIOS”。这是主要Logo——尽可能使用。 |
| 变体(全彩) | | 浅色/白色背景,且希望所有文本为黑色而非紫色+深灰色时使用。图标渐变效果相同。 |
| 单色黑色 | | 无法使用颜色的浅色背景(例如,打印、灰度场景)。灰度图标 + 近黑色文本。 |
| 单色白色 | | 仅用于深色背景。灰色图标 + 白色文本。当Logo位于深色表面(深色导航栏、深色英雄区块、覆盖层、深色模式)时使用。 |
Rules
规则
- Light mode (default): Use or
logo-on-white-default.svglogo-on-white-variant.svg - Dark mode or dark surfaces: Use — never place the default or black logo on a dark background
logo-mono-white.svg - The logo should appear in the sidebar header (web) or top bar (mobile) at the sizes defined in those patterns
- Do NOT resize the logo disproportionately — maintain the original aspect ratio
- Do NOT place the logo on busy backgrounds or low-contrast surfaces. If contrast is insufficient, use the mono variant that provides the best visibility
- Minimum clear space around the logo: on all sides
8px
- 浅色模式(默认):使用或
logo-on-white-default.svglogo-on-white-variant.svg - 深色模式或深色表面:使用——绝不能在深色背景上使用默认或黑色Logo
logo-mono-white.svg - Logo应出现在侧边栏头部(Web)或顶部栏(移动)中,尺寸遵循对应模式的定义
- 不得不成比例地调整Logo大小——保持原始宽高比
- 不得将Logo放置在杂乱的背景或低对比度的表面上。若对比度不足,请使用可见性最佳的单色变体
- Logo周围的最小留白:各边
8px
shadcn/ui Component Theming
shadcn/ui组件主题配置
Use shadcn/ui components as your base layer. Theme them using the CSS variables in . Here is how specific components should be configured:
references/theme.css以shadcn/ui组件为基础层,使用中的CSS变量进行主题配置。以下是特定组件的配置方式:
references/theme.cssButton
按钮
- Primary: bg,
brand-500(literal white, not a token),text-white. Hover:rounded-md.brand-600 - Secondary: White bg, border,
neutral-200text,neutral-900. Hover:rounded-mdbg.neutral-50 - Ghost: No bg, no border. text,
neutral-600. Hover:rounded-mdbg.neutral-100 - Destructive: bg,
error-500,text-white.rounded-md - All buttons: (8px),
rounded-mdfont.14px - Default height: (
48px). Use this on standalone pages, forms, modals, and any top-level content area.h-12 - Compact height: (
36px). Use when the button lives inside a smaller container — cards, panels, table rows, sidebar nav, filter bars, inline actions. The tighter context calls for a tighter control.h-9
- 主按钮:背景,
brand-500(纯白色,非令牌),text-white。悬停状态:rounded-md。brand-600 - 次按钮:白色背景,边框,
neutral-200文本,neutral-900。悬停状态:rounded-md背景。neutral-50 - 幽灵按钮:无背景、无边框。文本,
neutral-600。悬停状态:rounded-md背景。neutral-100 - 危险按钮:背景,
error-500,text-white。rounded-md - 所有按钮:(8px),
rounded-md字体。14px - 默认高度:(
48px)。用于独立页面、表单、模态框和任何顶级内容区域的按钮。h-12 - 紧凑高度:(
36px)。当按钮位于较小容器内时使用——卡片、面板、表格行、侧边栏导航、筛选栏、行内操作。紧凑场景需要紧凑控件。h-9
Badge
徽章
- (pill shape). Height
rounded-full. Caption-bold text (12px, 500 weight).22px - Semantic badges: Use pastel bg + darker text. E.g., success badge = bg,
success-50text.success-700 - Neutral badge: bg,
neutral-100text.neutral-700 - Brand badge: bg,
brand-50text.brand-700 - Always include a small dot or icon before the label when indicating status.
- (胶囊形状)。高度
rounded-full。粗体说明文本(12px/500字重)。22px - 语义化徽章:使用淡色背景 + 深色文本。例如,成功徽章 = 背景,
success-50文本。success-700 - 中性徽章:背景,
neutral-100文本。neutral-700 - 品牌徽章:背景,
brand-50文本。brand-700 - 指示状态时,标签前必须包含一个小点或图标。
Card
卡片
- White background ().
bg-neutral-01pxborder.neutral-200(10px).rounded-lg.shadow-sm - Internal padding: minimum,
16pxfor spacious cards.24px - Card headers: (16px/500) with optional "View all" link aligned right.
Heading 3 - Separate header from content with a
1pxdivider.neutral-200
- 白色背景()。
bg-neutral-01px边框。neutral-200(10px)。rounded-lg。shadow-sm - 内部内边距:最小,宽敞卡片使用
16px。24px - 卡片头部:三级标题(16px/500),右侧可选择性添加“查看全部”链接。
- 使用
1px分隔线分隔头部与内容。neutral-200
Table
表格
- Use shadcn . No outer border on the table itself — let the parent Card provide the container.
<Table> - Column headers: Caption-bold (12px/500), color, uppercase.
neutral-500 - Row height: . Rows separated by
48-56px1pxbottom border.neutral-200 - Row hover: background.
neutral-50 - No alternating row colors.
- 使用shadcn 。表格本身无外边框——由父卡片提供容器。
<Table> - 列标题:粗体说明文本(12px/500),颜色,全大写。
neutral-500 - 行高:。行之间使用
48-56px1px下边框分隔。neutral-200 - 行悬停:背景。
neutral-50 - 不使用交替行颜色。
Input / Textarea
输入框 / 文本域
- (8px).
rounded-md1pxborder.neutral-200bg or white bg.neutral-50 - Focus:
2pxring (use Tailwindbrand-500).ring-2 ring-brand-500 - Labels MUST be visible and external — render a element above every input, never inside it. Labels use
<label>/400 in14px. The gap between label and input isneutral-900(6px).space-y-1.5 - Placeholder text MUST be de-emphasized — color, normal weight (400), short hint text (e.g., "e.g. john@email.com"). Placeholders are supplementary hints, not labels.
neutral-400 - Select inputs follow the same pattern: visible label above, de-emphasized placeholder inside.
- Spacing between fields: (
16pxorspace-y-4).gap-4 - Default height: (
48px). Use for inputs on standalone pages, forms, modals, and any top-level content area.h-12 - Compact height: (
36px). Use when the input lives inside a smaller container — cards, panels, table rows, filter bars, inline search fields. Same logic as compact buttons.h-9
- (8px)。
rounded-md1px边框。neutral-200背景或白色背景。neutral-50 - 聚焦状态:
2px环(使用Tailwindbrand-500)。ring-2 ring-brand-500 - 标签必须可见且位于外部——在每个输入框上方渲染元素,绝不能放在输入框内。标签使用
<label>/400字重,14px颜色。标签与输入框之间的间距为neutral-900(6px)。space-y-1.5 - 占位符文本必须弱化——颜色,常规字重(400),简短提示文本(例如,“e.g. john@email.com”)。占位符是补充提示,而非标签。
neutral-400 - 选择输入框遵循相同模式:上方可见标签,内部弱化占位符。
- 字段之间的间距:(
16px或space-y-4)。gap-4 - 默认高度:(
48px)。用于独立页面、表单、模态框和任何顶级内容区域的输入框。h-12 - 紧凑高度:(
36px)。当输入框位于较小容器内时使用——卡片、面板、表格行、筛选栏、行内搜索框。逻辑与紧凑按钮相同。h-9
Sidebar (App Shell)
侧边栏(应用外壳)
See for the full sidebar code pattern. Key specs:
references/web-layouts.md- Width: . White background. Right border:
240px1px.neutral-200 - Nav items: height (compact — inside sidebar panel),
36px(6px),rounded-smleft padding.12px- Default: text. Active:
neutral-600bg,brand-50text,brand-500. Hover:font-weight: 500bg.neutral-100
- Default:
- Group labels: Caption (12px/400), ,
neutral-400top margin between groups.24px - On mobile: Sidebar collapses to a (slide-in from left).
Sheet
完整的侧边栏代码模式请阅读。关键规格:
references/web-layouts.md- 宽度:。白色背景。右侧边框:
240px1px。neutral-200 - 导航项:高度(紧凑——位于侧边栏面板内),
36px(6px),左侧内边距rounded-sm。12px- 默认状态:文本。激活状态:
neutral-600背景,brand-50文本,brand-500。悬停状态:font-weight: 500背景。neutral-100
- 默认状态:
- 组标签:说明文本(12px/400),颜色,组之间的顶部边距为
neutral-400。24px - 移动端:侧边栏折叠为(从左侧滑入)。
Sheet
Tabs
标签页
- Use shadcn . Underline variant.
<Tabs> - Active tab: bottom border (2px),
brand-500text.neutral-900 - Inactive tab: no border, text. Hover:
neutral-500text.neutral-900
- 使用shadcn 。下划线变体。
<Tabs> - 激活标签:底部边框(2px),
brand-500文本。neutral-900 - 未激活标签:无边框,文本。悬停状态:
neutral-500文本。neutral-900
Dialog / Sheet
对话框 / 弹窗
- Overlay: opacity.
black/50 - Container: white bg, (14px),
rounded-xl.shadow-overlay - Always include a close button (X icon) top-right.
- 覆盖层:透明度。
black/50 - 容器:白色背景,(14px),
rounded-xl。shadow-overlay - 右上角必须包含关闭按钮(X图标)。
Composite Patterns
复合模式
For rules and code examples, read the appropriate reference file:
- — Responsive rules, App Shell, Sidebar Navigation, Dashboard Grid, Data Table Page, Page Header
references/web-layouts.md - — Stat Card, List Item Row, Filter Bar, Kanban Board, Profile/Discovery Card, Product Card, Activity Feed Item, Toast Notifications, Form Validation States
references/components.md - — Mobile rules, Device Frame Shell, Mobile Top Bar, Bottom Tab Navigation, Mobile Form Layout, Pinned Bottom Button, Mobile List View, Mobile Card Stack, Full Screen Composition, Contextual Actions
references/mobile.md
规则和代码示例请阅读对应参考文件:
- — 响应式规则、应用外壳、侧边栏导航、仪表盘网格、数据表页面、页面头部
references/web-layouts.md - — 统计卡片、列表项行、筛选栏、看板、个人资料/发现卡片、产品卡片、活动流项、提示通知、表单验证状态
references/components.md - — 移动端规则、设备框架外壳、移动端顶部栏、底部标签导航、移动端表单布局、底部固定按钮、移动端列表视图、移动端卡片堆叠、全屏布局、上下文操作
references/mobile.md
Web vs Mobile Context
Web与移动端上下文差异
Every project is either a web application or a mobile application — the layout approach is fundamentally different. You MUST have already read the appropriate platform reference file (as instructed at the top of this document) before reaching this point. If you haven't, stop and read it now:
- Web application → (responsive breakpoints, sidebar behavior, layout patterns)
references/web-layouts.md - Mobile application (native app, iOS, Android, phone-based experience) → (device frame, touch targets, pinned buttons, navigation, mobile-specific rules)
references/mobile.md
Do NOT treat a mobile app as a responsive web page. Mobile apps render inside a device frame and follow entirely different navigation, spacing, and interaction patterns.
每个项目要么是Web应用要么是移动应用——布局方式完全不同。在阅读到本节之前,你必须已经阅读了对应平台的参考文件(如本文档顶部所述)。若未阅读,请立即停止并阅读:
- Web应用 → (响应式断点、侧边栏行为、布局模式)
references/web-layouts.md - 移动应用(原生应用、iOS、Android、基于手机的体验)→ (设备框架、触摸目标、固定按钮、导航、移动端专属规则)
references/mobile.md
请勿将移动应用视为响应式网页。移动应用在设备框架内渲染,遵循完全不同的导航、间距和交互模式。
Image Placeholders
图片占位符
When no real image is available, use soft gradient mesh backgrounds — NOT gray boxes. These should feel like abstract art, not loading states.
Gradient recipes (CSS or combos):
linear-gradientradial-gradient- Mint/Teal:
linear-gradient(135deg, #a8edea 0%, #fed6e3 50%, #a8edea 100%) - Peach/Coral:
linear-gradient(135deg, #f6d5c5 0%, #e8b4b8 50%, #d4a0a0 100%) - Purple/Pink:
linear-gradient(135deg, #c3b1e1 0%, #f0c4d0 50%, #e0aed0 100%) - Teal/Emerald:
linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)
Apply to image containers. These are placeholders — they should look intentional and beautiful.
rounded-lg当没有真实图片可用时,使用柔和渐变网格背景——而非灰色盒子。它们应看起来像抽象艺术,而非加载状态。
渐变配方(CSS 或组合):
linear-gradientradial-gradient- 薄荷/蓝绿色:
linear-gradient(135deg, #a8edea 0%, #fed6e3 50%, #a8edea 100%) - 桃色/珊瑚色:
linear-gradient(135deg, #f6d5c5 0%, #e8b4b8 50%, #d4a0a0 100%) - 紫色/粉色:
linear-gradient(135deg, #c3b1e1 0%, #f0c4d0 50%, #e0aed0 100%) - 蓝绿色/翠绿色:
linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)
为图片容器应用。这些是占位符——应看起来有意且美观。
rounded-lgTransitions & Animations
过渡与动画
Every state change should feel smooth and intentional — no hard cuts. This applies across both web and mobile:
- Interactive elements (buttons, inputs, cards): Use or
transition-colorswith Tailwind's default duration (~150ms). State changes like hover, focus, and active should never feel instantaneous.transition-all - Page transitions: When navigating between views, apply a subtle slide or fade. A ease-out transition keeps things feeling responsive without sluggish.
150–300ms - Modals, Dialogs, Sheets: Always animate in and out. Sheets slide from their edge (left, right, bottom), dialogs/modals fade + scale up slightly from ~95% to 100%. The overlay backdrop should fade in (), not appear instantly.
opacity 0→50% - Lists and content loading: When new items appear (e.g., after a fetch), a subtle fade-in or stagger is preferred over a hard pop-in.
Nothing on screen should ever just "appear" or "disappear" — every visual change gets a brief, smooth transition.
每个状态变化都应流畅且自然——不得生硬切换。这适用于Web和移动端:
- 交互元素(按钮、输入框、卡片):使用或
transition-colors,搭配Tailwind默认时长(约150ms)。悬停、聚焦和激活等状态变化绝不能瞬间完成。transition-all - 页面过渡:在视图间导航时,应用微妙的滑动或淡入淡出效果。的缓出过渡既能保持响应性又不会显得迟缓。
150–300ms - 模态框、对话框、弹窗:必须有进入和退出动画。弹窗从对应边缘(左、右、下)滑入,对话框/模态框淡入并从约95%略微缩放至100%。覆盖层背景应淡入(),而非瞬间出现。
opacity 0→50% - 列表和内容加载:当新元素出现时(例如,获取数据后),微妙的淡入或 stagger 效果优于生硬弹出。
屏幕上的任何元素都绝不能“突然出现”或“突然消失”——所有视觉变化都应有短暂、流畅的过渡。
Empty, Error & Loading States
空状态、错误状态与加载状态
Every screen has at least three faces: populated, empty, and broken. AI-generated interfaces almost always show only the happy path with fake data. A polished interface acknowledges the other two.
每个屏幕至少有三种状态:已填充、空、异常。AI生成的界面通常只展示带虚假数据的理想状态。优质界面应考虑另外两种状态。
Empty State
空状态
When a list, table, or content area has no data yet (first-time use, zero results, cleared filters):
- Center a Lucide icon (,
48px) + a short heading (neutral-300) + one line of body text (Heading 3) vertically in the content areaneutral-500 - Optionally include a primary action button below the text (e.g., "Create your first project")
- Do NOT show an empty table with headers and no rows — that looks like a bug, not a feature
- Do NOT use illustrations or complex graphics. Keep it text + icon. Minimal.
当列表、表格或内容区域尚无数据时(首次使用、无结果、筛选后为空):
- 在内容区域内垂直居中显示一个Lucide图标(,
48px) + 简短标题(三级标题) + 一行正文文本(neutral-300)neutral-500 - 可选择性地在文本下方添加一个主操作按钮(例如,“创建你的第一个项目”)
- 不得显示只有表头没有行的空表格——这看起来像bug,而非功能
- 不得使用插图或复杂图形。保持文本+图标即可。极简风格。
Error State
错误状态
When something goes wrong (network failure, permission denied, server error):
- Same centered layout as empty state, but use for the icon color
error-500 - Icon: contextual — for network errors,
WifiOfffor permission,ShieldXas a generic fallbackAlertTriangle - Heading: brief, human-readable ("Something went wrong", "Couldn't load projects")
- Body: one sentence explaining what to do ("Check your connection and try again")
- Include a "Retry" button (variant) when the action is retryable
secondary
当出现问题时(网络故障、权限不足、服务器错误):
- 布局与空状态相同,但图标颜色使用
error-500 - 图标:上下文相关——网络错误使用,权限问题使用
WifiOff,通用 fallback 使用ShieldXAlertTriangle - 标题:简短、通俗易懂(“出了点问题”、“无法加载项目”)
- 正文:一行说明解决方法的文本(“检查网络连接后重试”)
- 当操作可重试时,包含一个“重试”按钮(次按钮变体)
Loading State
加载状态
When content is being fetched:
- For initial page loads: Show a single centered spinner (icon with
Loader2,animate-spin,24px). No skeleton screens unless explicitly requested — they add complexity without clarifying the designneutral-400 - For inline updates (e.g., submitting a form, loading more items): Swap the trigger button's label to a spinner + "Loading…" and disable the button
- For pull-to-refresh or lazy loading: A small spinner at the top or bottom of the list,
neutral-400
The anti-pattern rule "No animated skeletons or shimmer effects in static mockups" still stands — but a simple on a loader icon is fine for interactive interfaces.
animate-spin当内容正在获取时:
- 初始页面加载:显示单个居中的加载动画(图标 +
Loader2,animate-spin,24px)。除非明确要求,否则不使用骨架屏——它们会增加复杂度却无法明确设计neutral-400 - 行内更新(例如,提交表单、加载更多项):将触发按钮的标签替换为加载动画 + “加载中…”,并禁用按钮
- 下拉刷新或懒加载:在列表顶部或底部显示一个小加载动画,颜色
neutral-400
静态原型中仍需遵循“禁止使用动画骨架屏或闪烁效果”的反模式规则——但在交互式界面中,为加载图标添加简单的是可以的。
animate-spinForm Validation & Error Feedback
表单验证与错误反馈
Inputs need to clearly communicate when something is wrong. This applies to both web and mobile. For code examples, see the Form Validation States section in .
references/components.md输入框需要清晰地传达错误状态。这适用于Web和移动端。代码示例请阅读中的表单验证状态章节。
references/components.mdBehavioral Rules
行为规则
- Validate on blur (when the user leaves the field), not on every keystroke — keystroke validation feels aggressive
- Show errors inline, directly below the relevant field. Never collect errors at the top of the form — users shouldn't have to hunt
- When the user corrects the input and the field is valid, remove the error state immediately (on change, not on blur)
- If the form is submitted with errors, scroll to the first invalid field and focus it
- 在失焦时验证(当用户离开字段时),而非每次按键时验证——按键验证会显得咄咄逼人
- 错误信息内联显示,直接在对应字段下方。绝不能将错误收集在表单顶部——用户不应需要寻找错误
- 当用户修正输入且字段有效时,立即移除错误状态(在输入变化时,而非失焦时)
- 若表单提交时有错误,滚动到第一个无效字段并聚焦它
Success Confirmation (Post-Submit)
提交成功确认
After a successful form submission, provide clear feedback. Don't just silently navigate away:
- Option A: Toast notification confirming the action + navigate to the next logical screen
- Option B: Inline success message replacing the form content (useful for single-purpose screens like "Reset password")
表单提交成功后,提供清晰的反馈。不要只是静默跳转:
- 选项A:提示通知确认操作 + 导航到下一个逻辑页面
- 选项B:行内成功消息替换表单内容(适用于“重置密码”等单用途页面)
Toast Notifications
提示通知
Transient feedback messages that confirm actions, surface errors, or provide information. Use shadcn's toast component. For code examples and the full variant table, see the Toast Notification section in .
Sonnerreferences/components.md用于确认操作、显示错误或提供信息的临时反馈消息。使用shadcn的提示组件。代码示例和完整变体表请阅读中的提示通知章节。
Sonnerreferences/components.mdPositioning & Behavior
定位与行为
- Web: Bottom-right corner, from the edge
16px - Mobile: Top-center, below the status bar / top bar area
- Duration: default,
4000msfor messages with an action link. Error toasts should persist until dismissed6000ms - Stacking: Max 3 visible at once. New toasts push older ones up (web) or down (mobile)
- Animation: Slide in from the edge + fade. Slide out + fade on dismiss. Should feel like the Transitions & Animations section — smooth, never instant
- Web:右下角,距离边缘
16px - 移动端:顶部居中,状态栏/顶部栏下方
- 时长:默认,带操作链接的消息使用
4000ms。错误提示应保持显示直到被关闭6000ms - 堆叠:最多同时显示3个。新提示会将旧提示向上(Web)或向下(移动端)推送
- 动画:从边缘滑入 + 淡入。关闭时滑出 + 淡出。应符合过渡与动画章节的要求——流畅,绝不瞬间完成
Data Visualization Palette
数据可视化调色板
When rendering charts (Recharts, Chart.js, etc.), use this ordered color sequence so data visualizations feel native to the brand. The palette starts with the brand purple and fans out through distinguishable hues:
| Order | Name | Hex | Use |
|---|---|---|---|
| 1 | Brand | | Primary data series, single-metric charts |
| 2 | Teal | | Secondary series |
| 3 | Amber | | Tertiary series |
| 4 | Rose | | Fourth series, or "negative" in comparisons |
| 5 | Sky | | Fifth series |
| 6 | Lime | | Sixth series |
渲染图表(Recharts、Chart.js等)时,使用此有序颜色序列,使数据可视化与品牌风格一致。调色板从品牌紫色开始,扩展到可区分的色调:
| 顺序 | 名称 | 十六进制值 | 使用场景 |
|---|---|---|---|
| 1 | 品牌色 | | 主要数据系列、单指标图表 |
| 2 | 蓝绿色 | | 次要数据系列 |
| 3 | 琥珀色 | | 第三数据系列 |
| 4 | 玫瑰色 | | 第四数据系列,或比较中的“负值” |
| 5 | 天蓝色 | | 第五数据系列 |
| 6 | 酸橙色 | | 第六数据系列 |
Rules
规则
- For single-metric charts (one bar, one line, one donut), always use (
Brand)#5900FF - For two-series comparisons, use +
BrandTeal - Apply colors in order — don't skip or shuffle. Consistency across charts makes dashboards feel cohesive
- Use opacity fills for area charts (e.g.,
10%for brand area fill)#5900FF1A - Gridlines: . Axis labels:
neutral-200, caption size (12px). Axis lines:neutral-500neutral-300 - Tooltips: White bg, ,
shadow-md,rounded-mdborder — same treatment as popoversneutral-200 - Never use brand purple for "negative" or "declining" values — use Rose for that. Purple is always neutral-to-positive
- 单指标图表(单个条形、单条线、单个环形图)始终使用(
品牌色)#5900FF - 双系列比较使用+
品牌色蓝绿色 - 按顺序使用颜色——不得跳过或打乱。图表间的一致性使仪表盘更具凝聚力
- 面积图使用透明度填充(例如,品牌色面积填充使用
10%)#5900FF1A - 网格线:。轴标签:
neutral-200,说明文本大小(12px)。轴线:neutral-500neutral-300 - 提示框:白色背景,,
shadow-md,rounded-md边框——与弹出层处理方式相同neutral-200 - 绝不能将品牌紫色用于“负值”或“下降”数据——使用玫瑰色。紫色始终代表中性到正值
Dark Mode
深色模式
Dark mode is off by default. Only implement it when explicitly requested by the user or client. When dark mode is requested, follow these rules — do NOT improvise an inverted palette.
深色模式默认关闭。仅当用户或客户明确要求时才实现。当需要深色模式时,请遵循以下规则——不得自行设计反转调色板。
How It Works
工作原理
The theme file () includes a class block that overrides CSS custom properties. Adding to or a wrapper element flips the entire color system without changing any component code. The neutral scale inverts so existing utilities (, , ) automatically produce the correct dark-mode values.
references/theme.css.darkclass="dark"<html>text-neutral-900bg-neutral-50border-neutral-200主题文件()包含类块,用于覆盖CSS自定义属性。在或包裹元素上添加即可切换整个颜色系统,无需修改任何组件代码。中性色阶反转,因此现有工具类(、、)会自动生成正确的深色模式值。
references/theme.css.dark<html>class="dark"text-neutral-900bg-neutral-50border-neutral-200Token Behavior in Dark Mode
令牌在深色模式下的行为
You don't change token names in your code — the override changes the values behind them. Here's what each token resolves to:
.dark| Token (unchanged in code) | Light Mode Value | Dark Mode Value | Notes |
|---|---|---|---|
| | | Page background |
| | | Card surfaces |
| | | Borders / dividers |
| | | Page titles |
| | | Body text |
| | | Stays the same — mid-range |
| | | Subtext — readable on dark |
| | | Brighter for contrast on dark bg |
| | | Tinted backgrounds invert |
你无需修改代码中的令牌名称——覆盖会更改其背后的值。以下是每个令牌的对应值:
.dark| 令牌(代码中不变) | 浅色模式值 | 深色模式值 | 说明 |
|---|---|---|---|
| | | 页面背景 |
| | | 卡片表面 |
| | | 边框 / 分隔线 |
| | | 页面标题 |
| | | 正文文本 |
| | | 保持不变——中间色调 |
| | | 辅助文本——在深色背景上可读 |
| | | 在深色背景上更亮以提高对比度 |
| | | tinted背景反转 |
bg-white
vs bg-neutral-0
— Critical Distinction
bg-whitebg-neutral-0bg-white
vs bg-neutral-0
— 关键区别
bg-whitebg-neutral-0Tailwind's built-in and are NOT overridden in dark mode. They always resolve to literal and .
whiteblack#FFFFFF#000000- Use when you mean actual white — e.g., button text on a
text-whitebackground. This stays white in both modes. ✅brand-500 - Use (not
bg-neutral-0) for surfaces that should invert in dark mode — e.g., card backgrounds, sidebars, top bars.bg-whitemaps tobg-neutral-0in light and#FFFFFFin dark. ✅#0A0A0A - Use for page backgrounds. Maps to
bg-neutral-50in light,#FAFAFAin dark. ✅#171717
If you use on a card, it will stay bright white in dark mode — blinding. Use instead.
bg-whitebg-neutral-0Tailwind内置的和在深色模式下不会被覆盖。它们始终对应纯和。
whiteblack#FFFFFF#000000- 当需要纯白色时使用****——例如,
text-white背景上的按钮文本。在两种模式下都保持白色。✅brand-500 - 对于需要在深色模式下反转的表面,使用****(而非
bg-neutral-0)——例如,卡片背景、侧边栏、顶部栏。bg-white在浅色模式下对应bg-neutral-0,在深色模式下对应#FFFFFF。✅#0A0A0A - 页面背景使用****。浅色模式下对应
bg-neutral-50,深色模式下对应#FAFAFA。✅#171717
若在卡片上使用,它在深色模式下会保持亮白色——非常刺眼。请改用。
bg-whitebg-neutral-0Shadows in Dark Mode
深色模式下的阴影
Shadows are nearly invisible on dark surfaces. The block increases shadow opacity so elevation is still perceptible, but cards should primarily rely on their border (which maps to a subtle dark gray divider in dark mode) for definition.
.darkneutral-200阴影在深色表面上几乎不可见。块会增加阴影透明度,使层次仍然可感知,但卡片应主要依靠边框(在深色模式下对应微妙的深灰色分隔线)来定义边界。
.darkneutral-200Logo
Logo
Use — the only variant approved for dark surfaces.
assets/logo-mono-white.svg使用——这是唯一批准用于深色表面的变体。
assets/logo-mono-white.svgWhat NOT to Do in Dark Mode
深色模式下的禁止操作
- Do NOT manually set dark colors in component code — rely on the class override
.dark - Do NOT use for surfaces — use
bg-whiteso they invert properlybg-neutral-0 - Do NOT use for large tinted surfaces — use
brand-500(which maps to a dark purple in dark mode)brand-50 - Do NOT change spacing, radius, or typography — the spatial system is mode-independent
- 不得在组件代码中手动设置深色颜色——依赖类覆盖
.dark - 不得对表面使用——使用
bg-white使其正确反转bg-neutral-0 - 不得对大面积tinted表面使用——使用
brand-500(在深色模式下对应深紫色)brand-50 - 不得更改间距、圆角或排版——空间系统与模式无关
Anti-Patterns (Do NOT)
反模式(禁止操作)
- No gradients on buttons. Flat solid colors only.
- No colored page backgrounds. Background is always or
neutral-50.neutral-0 - No heavy borders. Max for structural borders. Never 2px+.
1px - No rounded-full on cards. Cards are (10px), never circles.
rounded-lg - No custom fonts. DM Sans / sans-serif only. Monospace for code.
- Prefer icon + label navigation on desktop. Icon-only sidebars are acceptable if a tooltip with the label appears on hover or focus.
- No dark mode unless explicitly requested. Default is always light.
- No animated skeletons or shimmer effects in static mockups.
- No drop shadows on text. Ever.
- No border-radius mixing. Don't use the same radius token at different hierarchy levels — e.g., cards should contain
rounded-lgchildren, notrounded-smchildren. The inner radius should always be smaller than the outer.rounded-lg - No floating labels or placeholder-as-label. Labels must always be visible above inputs. Placeholders are hints, not labels — they vanish on focus and users lose context.
- No emojis in the UI. Icons only. The only exception is user-generated content — if a user typed an emoji, display it. But never add emojis to labels, headings, buttons, nav items, placeholders, or any system-generated text.
- 按钮上不得使用渐变。仅使用纯平纯色。
- 不得使用彩色页面背景。背景始终为或
neutral-50。neutral-0 - 不得使用厚重边框 structural边框最大为。绝不能使用2px及以上边框。
1px - 卡片不得使用rounded-full。卡片使用(10px),绝不能是圆形。
rounded-lg - 不得使用自定义字体。仅使用DM Sans / sans-serif。代码使用等宽字体。
- 桌面端优先使用图标+标签导航。若悬停或聚焦时显示带标签的提示框,则纯图标侧边栏是可以接受的。
- 除非明确要求,否则不得使用深色模式。默认始终为浅色模式。
- 静态原型中不得使用动画骨架屏或闪烁效果。
- 文本上不得使用投影。绝对禁止。
- 不得混合使用圆角。不同层级不得使用相同的圆角令牌——例如,卡片内应包含
rounded-lg子元素,而非rounded-sm子元素。内部圆角必须小于外部圆角。rounded-lg - 不得使用浮动标签或占位符作为标签。标签必须始终显示在输入框上方。占位符是提示,而非标签——它们在聚焦时会消失,用户会失去上下文。
- UI中不得使用表情符号。仅使用图标。唯一例外是用户生成的内容——若用户输入了表情符号,则显示它。但绝不能在标签、标题、按钮、导航项、占位符或任何系统生成的文本中添加表情符号。
Checklist Before Output
输出前检查清单
Before delivering any UI code, verify:
- Uses font family (with
DM Sansfallback)sans-serif - Brand purple only on interactive/active elements
- Cards have +
bg-neutral-0border +neutral-200+rounded-lgshadow-sm - No unauthorized colors, fonts, or shadows
- All icons from Lucide React
- shadcn components used where available (not custom recreations)
- Spacing feels generous — nothing cramped
- Page background is , not white
neutral-50 - Empty states are handled (not just the happy path with fake data)
- Form inputs show error styling on validation failure (red border + message below)
- Actions provide feedback via toast or inline confirmation
- Charts (if present) use the data visualization palette in order
- All form inputs have visible external labels (not inside the input)
- Placeholder text is de-emphasized (, normal weight)
neutral-400 - Casper Studios logo uses the correct variant for the background (default on light, mono-white on dark)
- If dark mode was requested: class applied, logo uses mono-white variant, surfaces use
.dark(notbg-neutral-0)bg-white - Border-radius: buttons/inputs use (8px), cards use
rounded-md(10px), nav items/inner elements userounded-lg(6px)rounded-sm - Button/input heights: (
48px) by default,h-12(36px) when inside cards, panels, tables, or other compact containersh-9
在交付任何UI代码之前,请验证:
- 使用字体族(带
DM Sans后备字体)sans-serif - 品牌紫色仅用于交互/激活元素
- 卡片使用+
bg-neutral-0边框 +neutral-200+rounded-lgshadow-sm - 未使用未经授权的颜色、字体或阴影
- 所有图标来自Lucide React
- 尽可能使用shadcn组件(而非自定义重写)
- 间距充裕——无拥挤内容
- 页面背景为,而非白色
neutral-50 - 处理了空状态(而非仅展示带虚假数据的理想状态)
- 表单输入框在验证失败时显示错误样式(红色边框 + 下方消息)
- 操作通过提示通知或行内确认提供反馈
- 图表(若有)按顺序使用数据可视化调色板
- 所有表单输入框有可见的外部标签(不在输入框内)
- 占位符文本已弱化(,常规字重)
neutral-400 - Casper Studios Logo根据背景使用了正确的变体(浅色背景用默认版,深色背景用单色白色版)
- 若要求深色模式:已应用类,Logo使用单色白色变体,表面使用
.dark(而非bg-neutral-0)bg-white - 圆角:按钮/输入框使用(8px),卡片使用
rounded-md(10px),导航项/内部元素使用rounded-lg(6px)rounded-sm - 按钮/输入框高度:默认(
48px),位于卡片、面板、表格或其他紧凑容器内时使用h-12(36px)h-9
Additional checks for Web Applications:
Web应用额外检查项:
- Sidebar follows the 240px / grouped nav / active state pattern
- Responsive: works at 1280px, 768px, and 375px
- 侧边栏遵循240px宽度 / 分组导航 / 激活状态模式
- 响应式:在1280px、768px和375px分辨率下均可正常工作
Additional checks for Mobile Applications:
移动应用额外检查项:
- Rendered inside iPhone 16 device frame (393×852, 40px outer radius, 8px bezel)
- Primary action button is pinned to bottom with safe area padding
- Navigation uses bottom tab bar, not sidebar
- Buttons and inputs are height (same as global default — no mobile override needed)
48px - Most tap targets are 44×44px or larger (smaller is OK in dense UI, but not the default)
- Single-column layout only — no multi-column grids
- Typography uses mobile scale (H1: 24px, H2: 18px)
- 在iPhone 16设备框架内渲染(393×852,40px外圆角,8px边框)
- 主操作按钮固定在底部并包含安全区域内边距
- 使用底部标签导航,而非侧边栏
- 按钮和输入框高度为(与全局默认值相同——无需移动端覆盖)
48px - 大多数触摸目标为44×44px或更大(紧凑UI中可更小,但非默认)
- 仅使用单列布局——无多列网格
- 排版使用移动端字号体系(一级标题:24px,二级标题:18px)