casper-design-system by casper-studios/casper-marketplace
npx skills add https://github.com/casper-studios/casper-marketplace --skill casper-design-system一个基于 shadcn/ui、Tailwind CSS v4 和 React (Vite) 构建的简洁、高雅的 SaaS 设计系统。为 Casper Studios 生成的每个界面——无论是客户演示、内部工具还是快速原型——都必须遵循这些规则,以在整个团队中保持统一、专业的视觉形象。
在生成任何 UI 代码之前,请完整阅读本文档 以及 下面列出的参考文件。你 必须 阅读参考文件——它们包含正确输出所需的规则和代码示例。跳过它们将产生不正确、不符合品牌形象的 UI。
每个项目都必需的文件:
references/components.md — 必须 阅读。可复用组件:统计卡片、列表项、筛选栏、看板、个人资料卡片、产品卡片、活动动态、提示通知、表单验证状态。每当在布局内构建 UI 元素时都需要。references/theme.css — 必须 阅读。Tailwind CSS v4 主题令牌。将此文件原样复制到你的项目中。assets/ — 包含 Casper Studios 徽标的 4 种变体(默认、变体、单色黑、单色白)。根据背景颜色使用正确的变体——请参阅下面的徽标部分。根据平台必需的文件:
references/web-layouts.md — 当项目是 时 阅读。Web 特定的响应式规则 + 代码示例:应用外壳、侧边栏导航、仪表板网格、数据表格页面、页面标题。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/mobile.md — 当项目是 移动应用程序 时 必须 阅读。移动端特定规则 + 代码示例:设备框架、顶部栏、底部标签导航、表单模式、固定按钮布局、列表视图、卡片堆叠、全屏构图、上下文操作(菜单 + 底部操作表)。不容商量: 在没有先阅读平台参考文件的情况下,不要生成 UI。如果你不确定项目是 Web 端还是移动端,请在继续之前询问用户。
在生成任何 UI 代码之前,请向用户确认以下信息。如果他们的提示已经清楚地回答了这些问题,则无需询问直接继续。如果没有,请在生成任何内容之前询问。
.dark 类覆盖、使用 bg-neutral-0 作为表面背景,以及是否包含单色白徽标变体。)不要为这些假设默认值。如果用户说“给我建一个仪表板”,你并不知道它是 Web 端还是移动端,或者是否需要深色模式。请询问。
Casper 的美学风格是 简洁权威 —— 一种专业的 SaaS 风格,感觉高级而不刻意。它使用大量的留白、克制的紫色点缀和柔和的圆角表面,创造出感觉值得信赖且现代的界面。想象一下 Linear 与 Notion 的结合:结构清晰、呼吸感强、低调自信。
#5900FF) 出现在激活状态、主要按钮和关键操作上——其他地方不使用。如果到处都是紫色,那就没有重点了。shadow-sm,弹出层使用 shadow-md。切勿在页面内元素上使用 shadow-lg。references/theme.css 中的主题文件作为 Casper 品牌覆盖shadcn init),然后在上面叠加 references/theme.css 中的 Casper 品牌令牌。shadcn 语义层 (bg-background、text-foreground、bg-primary、border-border 等) 是基础——Casper 的 theme.css 在此基础上添加品牌颜色、排版、阴影和间距,而不是替代它。直接使用 shadcn 组件。不要 创建重复 shadcn 功能的自定义基础组件DM Sans,sans-serif 作为后备字体。通过 Google Fonts 加载或捆绑调色板经过刻意限制。大部分 UI 是中性灰 + 白色,紫色作为鲜明的点缀色。
| 角色 | 令牌 | 十六进制 | 何时使用 |
|---|---|---|---|
| 品牌点缀色 | brand-500 | #5900FF | 激活的导航项、主要按钮、链接、焦点环 |
| 品牌柔和色 | brand-50 | #EEE5FF | 激活的导航背景、选中的行高亮、悬停色调 |
| 品牌浅色 | brand-100 | #DECCFF | 图标圆形背景、柔和标签填充色 |
| 默认文本 | neutral-950 | #0A0A0A | 页面标题、标题 |
| 正文文本 | neutral-900 | #171717 | 主要正文文本 |
| 辅助文本 | neutral-500 | #737373 | 元数据、时间戳、次要标签 |
| 边框 | neutral-200 | #E5E5E5 | 卡片边框、分隔线、表格线条 |
| 表面背景 | neutral-50 | #FAFAFA | 卡片后面的页面背景 |
| 卡片表面 | neutral-0 | #FFFFFF | 卡片背景、面板(为兼容深色模式使用 bg-neutral-0——参见深色模式部分) |
这些仅用于状态指示器、徽章和上下文反馈——绝不用作装饰性点缀色。
success-500 (#22C55E) 用于徽章/图标,success-50 用于药丸背景error-500 (#EF4444) 用于徽章/图标,error-50 用于药丸背景warning-500 (#F59E0B) 用于徽章/图标,warning-50 用于药丸背景text-black/50,用 neutral-500)所有文本都使用 DM Sans,sans-serif 作为后备字体 (font-family: 'DM Sans', sans-serif)。等宽字体 (font-mono) 仅适用于代码块、数据标签和 ID。
| 样式 | 大小 | 字重 | 行高 | 用途 |
|---|---|---|---|---|
| 标题 1 | 30px | 500 | 36px | 仅用于页面标题。每个视图一个。 |
| 标题 2 | 20px | 500 | 24px | 页面内的分区标题 |
| 标题 3 | 16px | 500 | 20px | 卡片标题、子分区标签 |
| 正文 | 14px | 400 | 20px | 默认段落和 UI 文本 |
| 正文加粗 | 14px | 500 | 20px | 正文中的强调、表格标题 |
| 说明文字 | 12px | 400 | 16px | 时间戳、帮助文本、元数据 |
| 说明文字加粗 | 12px | 500 | 16px | 徽章标签、小型分类标签 |
medium 字重 (500),绝不 是粗体 (700)brand-500 颜色且无下划线,悬停时显示下划线使用 Tailwind 的默认间距比例。关键值:
4px (p-1) — 图标内边距、紧密间隙8px (p-2) — 徽章内边距、小间隙12px (p-3) — 输入框内边距、卡片内部间隙16px (p-4) — 卡片内边距、分区间隙24px (p-6) — 卡片之间、内容分区之间32px (p-8) — 主要分区之间的分隔48px (p-12) — 大屏幕上的页面级内边距neutral-50 (#FAFAFA)1280px 居中240px24px 内边距设计主要是扁平化的。阴影用于指示层级,而不是添加装饰。
| 令牌 | 用途 |
|---|---|
shadow-sm | 卡片、静止状态的输入框 |
shadow-md | 下拉菜单、弹出层、工具提示 |
shadow-lg | 仅用于 模态框、命令面板、覆盖层 |
shadow-overlay | shadow-lg 的语义别名——值相同。用于模态框/操作表,以便在代码中清晰表达意图 |
切勿 将 shadow-lg(或其别名 shadow-overlay)应用于卡片或页面内元素。这些仅保留给浮动层使用。
主题文件 (references/theme.css) 使用 shadcn/ui 圆角系统 —— :root 中的一个 --radius 基础变量,通过 calc() 控制整个比例。这通过 @theme inline 映射到 Tailwind 类中。没有覆盖 Tailwind v4 的默认值。
| 令牌 | Tailwind 类 | 默认值 | 用途 |
|---|---|---|---|
--radius-sm | rounded-sm | 6px | 内部元素、导航项、小型嵌套控件 |
--radius-md | rounded-md | 8px | 按钮、输入框、弹出层、工具提示、图表工具提示 |
--radius-lg | rounded-lg | 10px | 卡片、面板、大型容器 |
--radius-xl | rounded-xl | 14px | 模态框容器、对话框、主卡片 |
| (Tailwind 内置) | rounded-full | 9999px | 徽章、药丸、头像、图标圆形 |
基础值 --radius: 0.625rem (10px) 是 shadcn 的默认值。要使整个 UI 更锐利或更圆润,只需更改这个单一值——所有令牌会自动重新计算。
卡片始终使用 rounded-lg (10px)。按钮和输入框始终使用 rounded-md (8px)。卡片内的嵌套非交互元素应使用 rounded-sm (6px) 以保持视觉层次——内部圆角应始终小于外部圆角。
import { IconName } from "lucide-react"16px,独立为 20pxneutral-500,激活状态用 brand-500)40px,brand-50 或 brand-100 背景,rounded-full20px,brand-500 颜色error-50 背景 + error-500 图标)Casper Studios 徽标有四种变体,存储在 assets/ 中。根据其所在的背景使用正确的变体:
| 变体 | 文件 | 何时使用 |
|---|---|---|
| 默认(全彩) | assets/logo-on-white-default.svg | 浅色/白色背景。渐变图标 + 紫色 "CASPER" + 深色 "STUDIOS"。这是主要徽标——尽可能使用它。 |
| 变体(全彩) | assets/logo-on-white-variant.svg | 浅色/白色背景,当你想要全黑文本而不是紫色 + 深灰色时使用。相同的渐变图标。 |
| 单色黑 | assets/logo-mono-black.svg | 颜色不可用的浅色背景(例如,打印、灰度上下文)。灰度图标 + 接近黑色的文本。 |
| 单色白 | assets/logo-mono-white.svg | 仅用于深色背景。 灰色图标 + 白色文本。每当徽标位于深色表面时使用此变体(深色导航栏、深色主图部分、覆盖层、深色模式)。 |
logo-on-white-default.svg 或 logo-on-white-variant.svglogo-mono-white.svg —— 切勿在深色背景上放置默认或黑色徽标8px使用 shadcn/ui 组件作为你的基础层。使用 references/theme.css 中的 CSS 变量对它们进行主题化。以下是特定组件的配置方式:
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。rounded-md (8px),14px 字体。48px (h-12)。用于独立页面、表单、模态框和任何顶级内容区域。36px (h-9)。当按钮位于较小的容器内时使用——卡片、面板、表格行、侧边栏导航、筛选栏、内联操作。更紧凑的上下文需要更紧凑的控件。rounded-full(药丸形状)。高度 22px。说明文字加粗文本 (12px,500 字重)。success-50 背景,success-700 文本。neutral-100 背景,neutral-700 文本。brand-50 背景,brand-700 文本。bg-neutral-0)。1px neutral-200 边框。rounded-lg (10px)。shadow-sm。16px,宽敞卡片用 24px。标题 3 (16px/500),可选的 "查看全部" 链接右对齐。1px neutral-200 分隔线将标题与内容分开。<Table>。表格本身没有外边框——让父级卡片提供容器。neutral-500 颜色,大写。48-56px。行之间用 1px neutral-200 底部边框分隔。neutral-50 背景。rounded-md (8px)。1px neutral-200 边框。neutral-50 背景或白色背景。2px brand-500 环(使用 Tailwind ring-2 ring-brand-500)。<label> 元素,切勿 放在里面。标签使用 14px/400,neutral-900。标签和输入框之间的间隙是 6px (space-y-1.5)。neutral-400 颜色,正常字重 (400),简短的提示文本(例如,"例如 john@email.com")。占位符是补充提示,不是标签。16px (space-y-4 或 gap-4)。48px (h-12)。用于独立页面、表单、模态框和任何顶级内容区域的输入框。36px (h-9)。当输入框位于较小的容器内时使用——卡片、面板、表格行、筛选栏、内联搜索字段。与紧凑按钮的逻辑相同。完整侧边栏代码模式请参阅 references/web-layouts.md。关键规格:
240px。白色背景。右边框:1px neutral-200。36px(紧凑——在侧边栏面板内),rounded-sm (6px),左内边距 12px。
neutral-600 文本。激活:brand-50 背景,brand-500 文本,font-weight: 500。悬停:neutral-100 背景。neutral-400,组间上边距 24px。Sheet(从左侧滑入)。<Tabs>。下划线变体。brand-500 底部边框 (2px),neutral-900 文本。neutral-500 文本。悬停:neutral-900 文本。black/50 不透明度。rounded-xl (14px),shadow-overlay。有关规则和代码示例,请阅读相应的参考文件:
references/web-layouts.md — 响应式规则、应用外壳、侧边栏导航、仪表板网格、数据表格页面、页面标题references/components.md — 统计卡片、列表项行、筛选栏、看板、个人资料/发现卡片、产品卡片、活动动态项、提示通知、表单验证状态references/mobile.md — 移动端规则、设备框架外壳、移动端顶部栏、底部标签导航、移动端表单布局、固定底部按钮、移动端列表视图、移动端卡片堆叠、全屏构图、上下文操作每个项目要么是 Web 应用程序,要么是 移动应用程序 —— 布局方法根本不同。在到达这一点之前,你必须已经阅读了相应的平台参考文件(如本文档顶部所述)。如果还没有,请停止并立即阅读:
references/web-layouts.md(响应式断点、侧边栏行为、布局模式)references/mobile.md(设备框架、触摸目标、固定按钮、导航、移动端特定规则)不要将移动应用视为响应式网页。移动应用在设备框架内渲染,并遵循完全不同的导航、间距和交互模式。
当没有真实图片可用时,使用 柔和的渐变网格背景 —— 不要用灰色方框。这些应该感觉像抽象艺术,而不是加载状态。
渐变配方(CSS linear-gradient 或 radial-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-lg。这些是占位符——它们应该看起来是有意为之且美观的。
每个状态变化都应该感觉流畅且有意图——没有生硬的切换。这适用于 Web 端和移动端:
transition-colors 或 transition-all 配合 Tailwind 的默认持续时间(约 150ms)。悬停、焦点和激活等状态变化绝不应感觉是瞬间的。150–300ms 的缓出过渡可以保持响应感而不迟钝。opacity 0→50%),而不是瞬间出现。屏幕上的任何内容都不应该只是“出现”或“消失”——每个视觉变化都应该有一个短暂、平滑的过渡。
每个屏幕至少有三个状态:有内容、空状态和出错状态。AI 生成的界面几乎总是只显示带有虚假数据的理想路径。一个精致的界面会考虑到其他两种状态。
当列表、表格或内容区域尚无数据时(首次使用、零结果、清除筛选条件):
48px,neutral-300) + 一个简短的标题 (标题 3) + 一行正文文本 (neutral-500)当出现问题时(网络故障、权限被拒绝、服务器错误):
error-500WifiOff,权限问题用 ShieldX,通用回退用 AlertTrianglesecondary 变体)当内容正在获取时:
Loader2 图标,带 animate-spin,24px,neutral-400)。除非明确要求,否则不要使用骨架屏——它们增加了复杂性而没有明确设计neutral-400反模式规则“静态模型中没有动画骨架屏或微光效果”仍然成立——但加载器图标上的简单 animate-spin 对于交互式界面是可以的。
输入框需要清楚地传达何时出现问题。这适用于 Web 端和移动端。代码示例请参阅 references/components.md 中的表单验证状态部分。
表单提交成功后,提供清晰的反馈。不要只是默默地导航离开:
确认操作、显示错误或提供信息的临时反馈消息。使用 shadcn 的 Sonner 提示组件。代码示例和完整的变体表格请参阅 references/components.md 中的提示通知部分。
16px4000ms,带有操作链接的消息 6000ms。错误提示应持续显示直到被关闭渲染图表(Recharts、Chart.js 等)时,使用此有序的颜色序列,使数据可视化感觉与品牌原生。调色板从品牌紫色开始,通过可区分的色调展开:
| 顺序 | 名称 | 十六进制 | 用途 |
|---|---|---|---|
| 1 | 品牌色 | #5900FF | 主要数据系列、单一指标图表 |
| 2 | 蓝绿色 | #14B8A6 | 次要系列 |
| 3 | 琥珀色 | #F59E0B | 第三系列 |
| 4 | 玫瑰色 | #F43F5E | 第四系列,或比较中的“负值” |
| 5 | 天蓝色 | #0EA5E9 | 第五系列 |
| 6 | 柠檬绿 | #84CC16 | 第六系列 |
品牌色 (#5900FF)品牌色 + 蓝绿色10% 不透明度填充(例如,品牌面积填充用 #5900FF1A)neutral-200。坐标轴标签:neutral-500,说明文字大小 (12px)。坐标轴线:neutral-300shadow-md,rounded-md,neutral-200 边框——与弹出层相同的处理方式深色模式默认关闭。仅当用户或客户明确要求时才实现它。当请求深色模式时,请遵循这些规则——不要即兴创作反转的调色板。
主题文件 (references/theme.css) 包含一个 .dark 类块,用于覆盖 CSS 自定义属性。向 <html> 或包装元素添加 class="dark" 会翻转整个色彩系统,而无需更改任何组件代码。中性色阶会反转,因此现有的工具类 (text-neutral-900、bg-neutral-50、border-neutral-200) 会自动产生正确的深色模式值。
你不需要在代码中更改令牌名称——.dark 覆盖会更改它们背后的值。以下是每个令牌解析为的值:
| 令牌(代码中不变) | 浅色模式值 | 深色模式值 | 备注 |
|---|---|---|---|
bg-neutral-50 | #FAFAFA (浅灰色) | #171717 (接近黑色) | 页面背景 |
bg-neutral-0 | #FFFFFF (白色) | #0A0A0A (接近黑色) | 卡片表面 |
border-neutral-200 | #E5E5E5 (浅灰色) | #404040 (深灰色) | 边框 / 分隔线 |
text-neutral-950 | #0A0A0A (接近黑色) | #FFFFFF (白色) | 页面标题 |
text-neutral-900 | #171717 (接近黑色) | #FAFAFA (接近白色) | 正文文本 |
text-neutral-500 | #737373 (中灰色) | #737373 (中灰色) | 保持不变——中范围 |
text-neutral-400 | #A3A3A3 (浅灰色) | #A3A3A3 (保持不变) | 辅助文本——在深色上可读 |
bg-brand-500 | #5900FF | #7A33FF (更亮) | 更亮以在深色背景上形成对比 |
bg-brand-50 | #EEE5FF (浅紫色) | #120033 (非常深的紫色) | 着色背景反转 |
bg-white 与 bg-neutral-0 —— 关键区别Tailwind 内置的 white 和 black 在深色模式下不被覆盖。它们始终解析为纯 #FFFFFF 和 #000000。
text-white 当你指的是纯白色时——例如,brand-500 背景上的按钮文本。这在两种模式下都保持白色。✅bg-neutral-0(而不是 bg-white)用于应在深色模式下反转的表面——例如,卡片背景、侧边栏、顶部栏。bg-neutral-0 在浅色模式下映射到 #FFFFFF,在深色模式下映射到 #0A0A0A。✅bg-neutral-50 用于页面背景。在浅色模式下映射到 #FAFAFA,在深色模式下映射到 #171717。✅如果你在卡片上使用 bg-white,它在深色模式下将保持亮白色——刺眼。请改用 bg-neutral-0。
阴影在深色表面上几乎不可见。.dark 块增加了阴影不透明度,以便层级仍然可感知,但卡片应主要依靠其 neutral-200 边框(在深色模式下映射为微妙的深灰色分隔线)来定义。
使用 assets/logo-mono-white.svg —— 唯一批准用于深色表面的变体。
.dark 类覆盖bg-white 作为表面——使用 bg-neutral-0 以便它们正确反转brand-500 作为大型着色表面——使用 brand-50(在深色模式下映射为深紫色)neutral-50 或 neutral-0。1px。绝不超过 2px。rounded-full。 卡片是 rounded-lg (10px),绝不是圆形。rounded-lg 卡片应包含 rounded-sm 子元素,而不是 rounded-lg 子元素。内部圆角应始终小于外部圆角。在交付任何 UI 代码之前,请验证:
DM Sans 字体系列(带 sans-serif 后备字体)bg-neutral-0A 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:
references/components.md — 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/theme.css — ALWAYS read. Tailwind CSS v4 theme tokens. Copy this file into your project as-is.assets/ — 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.Required based on platform:
references/web-layouts.md — 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/mobile.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).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.
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.
.dark class overrides, use bg-neutral-0 for surfaces, and include the mono-white logo variant.)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.
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.
#5900FF) appears on active states, primary buttons, and key CTAs — nowhere else. If everything is purple, nothing is.shadow-sm for cards, shadow-md for popovers. Never use shadow-lg on in-page elements.references/theme.css as Casper brand overridesshadcn init), then layer Casper brand tokens from references/theme.css on top. The shadcn semantic layer (bg-background, text-foreground, bg-primary, border-border, 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 functionalityDM Sans with as fallback for all UI text. Load via Google Fonts or bundleThe palette is intentionally restrained. Most of the UI is neutral gray + white, with purple as a sharp accent.
| Role | Token | Hex | When to use |
|---|---|---|---|
| Brand accent | brand-500 | #5900FF | Active nav items, primary buttons, links, focus rings |
| Brand subtle | brand-50 | #EEE5FF | Active nav background, selected row highlight, hover tints |
| Brand light | brand-100 | #DECCFF |
Use these ONLY for status indicators, badges, and contextual feedback — never as decorative accents.
success-500 (#22C55E) for badges/icons, success-50 for pill backgroundserror-500 (#EF4444) for badges/icons, error-50 for pill backgroundswarning-500 (#F59E0B) for badges/icons, warning-50 for pill backgroundstext-black/50, use neutral-500)All text is set in DM Sans with sans-serif as fallback (font-family: 'DM Sans', sans-serif). Monospace (font-mono) is acceptable for code blocks, data labels, and IDs only.
| 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 |
medium weight (500), never bold (700)brand-500 color with no underline by default, underline on hoverUse Tailwind's default spacing scale. Key values:
4px (p-1) — icon padding, tight gaps8px (p-2) — badge padding, small gaps12px (p-3) — input padding, card internal gaps16px (p-4) — card padding, section gaps24px (p-6) — between cards, content sections32px (p-8) — major section separation48px (p-12) — page-level padding on large screensneutral-50 (#FAFAFA)1280px centered240px fixed width24px paddingThe design is predominantly flat. Shadows are used to indicate layers, not to add decoration.
| Token | Use |
|---|---|
shadow-sm | Cards, inputs at rest |
shadow-md | Dropdown menus, popovers, tooltips |
shadow-lg | Modals, command palettes, overlays ONLY |
shadow-overlay | Semantic alias for shadow-lg — identical value. Use on modals/sheets so the intent reads clearly in code |
NEVER apply shadow-lg (or its alias shadow-overlay) to cards or in-page elements. These are reserved for floating layers only.
The theme file (references/theme.css) uses the shadcn/ui radius system — a single --radius base variable in :root that controls the entire scale via calc(). This is mapped into Tailwind classes via @theme inline. No Tailwind v4 defaults are overridden.
| Token | Tailwind Class | Default Value | Use |
|---|---|---|---|
--radius-sm | rounded-sm | 6px | Inner elements, nav items, small nested controls |
--radius-md | rounded-md | 8px | Buttons, inputs , popovers, tooltips, chart tooltips |
--radius-lg | rounded-lg |
The base value --radius: 0.625rem (10px) is the shadcn default. To make the entire UI sharper or rounder, change this single value — all tokens recalculate automatically.
Cards always use rounded-lg (10px). Buttons and inputs always use rounded-md (8px). Nested elements inside cards should use rounded-sm (6px) for non-interactive elements to maintain visual hierarchy — the inner radius should always be smaller than the outer.
import { IconName } from "lucide-react"16px for inline, 20px for standaloneneutral-500 for subtext, brand-500 for active)40px diameter, brand-50 or brand-100 background, rounded-full20px, colorThe Casper Studios logo has four variants stored in assets/. Use the correct variant based on the background it sits on:
| Variant | File | When to use |
|---|---|---|
| Default (full color) | assets/logo-on-white-default.svg | Light/white backgrounds. Gradient icon + purple "CASPER" + dark "STUDIOS". This is the primary logo — use it whenever possible. |
| Variant (full color) | assets/logo-on-white-variant.svg | Light/white backgrounds when you want all-black text instead of purple + dark gray. Same gradient icon. |
| Mono Black | assets/logo-mono-black.svg | Light backgrounds where color is unavailable (e.g., print, grayscale contexts). Grayscale icon + near-black text. |
| Mono White | assets/logo-mono-white.svg |
logo-on-white-default.svg or logo-on-white-variant.svglogo-mono-white.svg — never place the default or black logo on a dark background8px on all sidesUse shadcn/ui components as your base layer. Theme them using the CSS variables in references/theme.css. Here is how specific components should be configured:
brand-500 bg, text-white (literal white, not a token), rounded-md. Hover: brand-600.neutral-200 border, neutral-900 text, rounded-md. Hover: neutral-50 bg.neutral-600 text, rounded-md. Hover: bg.rounded-full (pill shape). Height 22px. Caption-bold text (12px, 500 weight).success-50 bg, success-700 text.neutral-100 bg, neutral-700 text.brand-50 bg, brand-700 text.bg-neutral-0). 1px neutral-200 border. rounded-lg (10px). shadow-sm.16px minimum, 24px for spacious cards.Heading 3 (16px/500) with optional "View all" link aligned right.1px neutral-200 divider.<Table>. No outer border on the table itself — let the parent Card provide the container.neutral-500 color, uppercase.48-56px. Rows separated by 1px neutral-200 bottom border.neutral-50 background.rounded-md (8px). 1px neutral-200 border. neutral-50 bg or white bg.2px brand-500 ring (use Tailwind ring-2 ring-brand-500).<label> element above every input, never inside it. Labels use 14px/400 in neutral-900. The gap between label and input is 6px ().See references/web-layouts.md for the full sidebar code pattern. Key specs:
240px. White background. Right border: 1px neutral-200.36px height (compact — inside sidebar panel), rounded-sm (6px), 12px left padding.
neutral-600 text. Active: brand-50 bg, brand-500 text, font-weight: 500. Hover: neutral-100 bg.<Tabs>. Underline variant.brand-500 bottom border (2px), neutral-900 text.neutral-500 text. Hover: neutral-900 text.black/50 opacity.rounded-xl (14px), shadow-overlay.For rules and code examples, read the appropriate reference file:
references/web-layouts.md — Responsive rules, App Shell, Sidebar Navigation, Dashboard Grid, Data Table Page, Page Headerreferences/components.md — Stat Card, List Item Row, Filter Bar, Kanban Board, Profile/Discovery Card, Product Card, Activity Feed Item, Toast Notifications, Form Validation Statesreferences/mobile.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 ActionsEvery 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:
references/web-layouts.md (responsive breakpoints, sidebar behavior, layout patterns)references/mobile.md (device frame, touch targets, pinned buttons, navigation, mobile-specific rules)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.
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 linear-gradient or radial-gradient combos):
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%)Apply rounded-lg to image containers. These are placeholders — they should look intentional and beautiful.
Every state change should feel smooth and intentional — no hard cuts. This applies across both web and mobile:
transition-colors or transition-all with Tailwind's default duration (~150ms). State changes like hover, focus, and active should never feel instantaneous.150–300ms ease-out transition keeps things feeling responsive without sluggish.opacity 0→50%), not appear instantly.Nothing on screen should ever just "appear" or "disappear" — every visual change gets a brief, smooth transition.
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.
When a list, table, or content area has no data yet (first-time use, zero results, cleared filters):
48px, neutral-300) + a short heading (Heading 3) + one line of body text (neutral-500) vertically in the content areaWhen something goes wrong (network failure, permission denied, server error):
error-500 for the icon colorWifiOff for network errors, ShieldX for permission, AlertTriangle as a generic fallbacksecondary variant) when the action is retryableWhen content is being fetched:
Loader2 icon with animate-spin, 24px, neutral-400). No skeleton screens unless explicitly requested — they add complexity without clarifying the designneutral-400The anti-pattern rule "No animated skeletons or shimmer effects in static mockups" still stands — but a simple animate-spin on a loader icon is fine for interactive interfaces.
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.
After a successful form submission, provide clear feedback. Don't just silently navigate away:
Transient feedback messages that confirm actions, surface errors, or provide information. Use shadcn's Sonner toast component. For code examples and the full variant table, see the Toast Notification section in references/components.md.
16px from the edge4000ms default, 6000ms for messages with an action link. Error toasts should persist until dismissedWhen 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 | #5900FF | Primary data series, single-metric charts |
| 2 | Teal | #14B8A6 | Secondary series |
| 3 | Amber | #F59E0B | Tertiary series |
| 4 | Rose | #F43F5E | Fourth series, or "negative" in comparisons |
| 5 |
Brand (#5900FF)Brand + Teal10% opacity fills for area charts (e.g., #5900FF1A for brand area fill)neutral-200. Axis labels: neutral-500, caption size (12px). Axis lines: neutral-300shadow-md, , border — same treatment as popoversDark 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.
The theme file (references/theme.css) includes a .dark class block that overrides CSS custom properties. Adding class="dark" to <html> or a wrapper element flips the entire color system without changing any component code. The neutral scale inverts so existing utilities (text-neutral-900, bg-neutral-50, border-neutral-200) automatically produce the correct dark-mode values.
You don't change token names in your code — the .dark override changes the values behind them. Here's what each token resolves to:
| Token (unchanged in code) | Light Mode Value | Dark Mode Value | Notes |
|---|---|---|---|
bg-neutral-50 | #FAFAFA (light gray) | #171717 (near-black) | Page background |
bg-neutral-0 | #FFFFFF (white) | #0A0A0A (near-black) | Card surfaces |
border-neutral-200 |
bg-white vs bg-neutral-0 — Critical DistinctionTailwind's built-in white and black are NOT overridden in dark mode. They always resolve to literal #FFFFFF and #000000.
text-white when you mean actual white — e.g., button text on a brand-500 background. This stays white in both modes. ✅bg-neutral-0 (not bg-white) for surfaces that should invert in dark mode — e.g., card backgrounds, sidebars, top bars. bg-neutral-0 maps to #FFFFFF in light and #0A0A0A in dark. ✅bg-neutral-50 for page backgrounds. Maps to #FAFAFA in light, #171717 in dark. ✅If you use bg-white on a card, it will stay bright white in dark mode — blinding. Use bg-neutral-0 instead.
Shadows are nearly invisible on dark surfaces. The .dark block increases shadow opacity so elevation is still perceptible, but cards should primarily rely on their neutral-200 border (which maps to a subtle dark gray divider in dark mode) for definition.
Use assets/logo-mono-white.svg — the only variant approved for dark surfaces.
.dark class overridebg-white for surfaces — use bg-neutral-0 so they invert properlybrand-500 for large tinted surfaces — use brand-50 (which maps to a dark purple in dark mode)neutral-50 or neutral-0.1px for structural borders. Never 2px+.rounded-lg (10px), never circles.rounded-lg cards should contain rounded-sm children, not children. The inner radius should always be smaller than the outer.Before delivering any UI code, verify:
DM Sans font family (with sans-serif fallback)bg-neutral-0 + neutral-200 border + rounded-lg + shadow-smneutral-50, not white48px height (same as global default — no mobile override needed)Weekly Installs
97
Repository
GitHub Stars
9
First Seen
Feb 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode97
github-copilot97
codex97
kimi-cli97
gemini-cli97
cursor97
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装
sans-serif| Icon circle backgrounds, soft tag fills |
| Default text | neutral-950 | #0A0A0A | Page titles, headings |
| Body text | neutral-900 | #171717 | Primary body text |
| Subtext | neutral-500 | #737373 | Metadata, timestamps, secondary labels |
| Borders | neutral-200 | #E5E5E5 | Card borders, dividers, table lines |
| Surface | neutral-50 | #FAFAFA | Page background behind cards |
| Card surface | neutral-0 | #FFFFFF | Card backgrounds, panels (use bg-neutral-0 for dark mode compatibility — see Dark Mode section) |
| Caption | 12px | 400 | 16px | Timestamps, helper text, metadata |
| Caption Bold | 12px | 500 | 16px | Badge labels, small category tags |
| 10px |
| Cards, panels, large containers |
--radius-xl | rounded-xl | 14px | Modal containers, dialogs, hero cards |
| (Tailwind built-in) | rounded-full | 9999px | Badges, pills, avatars, icon circles |
brand-500error-50 bg + error-500 icon)| 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). |
neutral-100error-500 bg, text-white, rounded-md.rounded-md (8px), 14px font.48px (h-12). Use this on standalone pages, forms, modals, and any top-level content area.36px (h-9). 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.space-y-1.5neutral-400 color, normal weight (400), short hint text (e.g., "e.g. john@email.com"). Placeholders are supplementary hints, not labels.16px (space-y-4 or gap-4).48px (h-12). Use for inputs on standalone pages, forms, modals, and any top-level content area.36px (h-9). Use when the input lives inside a smaller container — cards, panels, table rows, filter bars, inline search fields. Same logic as compact buttons.neutral-400, 24px top margin between groups.Sheet (slide-in from left).| Sky |
#0EA5E9 |
| Fifth series |
| 6 | Lime | #84CC16 | Sixth series |
rounded-mdneutral-200#E5E5E5 (light gray) |
#404040 (dark gray) |
| Borders / dividers |
text-neutral-950 | #0A0A0A (near-black) | #FFFFFF (white) | Page titles |
text-neutral-900 | #171717 (near-black) | #FAFAFA (near-white) | Body text |
text-neutral-500 | #737373 (mid-gray) | #737373 (mid-gray) | Stays the same — mid-range |
text-neutral-400 | #A3A3A3 (light gray) | #A3A3A3 (stays same) | Subtext — readable on dark |
bg-brand-500 | #5900FF | #7A33FF (lighter) | Brighter for contrast on dark bg |
bg-brand-50 | #EEE5FF (light purple) | #120033 (very dark purple) | Tinted backgrounds invert |
rounded-lgneutral-400.dark class applied, logo uses mono-white variant, surfaces use bg-neutral-0 (not bg-white)rounded-md (8px), cards use rounded-lg (10px), nav items/inner elements use rounded-sm (6px)48px (h-12) by default, 36px (h-9) when inside cards, panels, tables, or other compact containers