.cursor/skills/dark-mode-design/SKILL.md
Design and implementation guidelines for dark mode. Covers common pitfalls, color palette, Tailwind replacement patterns. Use when implementing dark mode, designing dark themes, or reviewing dark mode implementations.
npx skillsauth add Aafff623/pet-adoption-app dark-mode-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
触发词:暗色模式、dark mode、深色主题、暗色主题、主题切换、prefers-color-scheme
| 坑点 | 规避策略 |
|------|----------|
| 纯黑 (#000) + 纯白 (#fff) | 使用深灰背景 (#18181b, #27272a) 和浅灰文字 (#e4e4e7),避免极端对比 |
| 阴影在暗色下失效 | 用边框 + 轻微提亮背景色表现层级,而非依赖 shadow |
| 高饱和色在暗底上刺眼 | 暗色模式下 primary 适当降饱和或提高明度 |
| 细灰分割线消失 | 使用 border-zinc-700/600 替代 border-gray-100/200 |
| 模态遮罩不可见 | 暗色下用 bg-black/60 或 bg-white/5,保证与背景区分 |
| 浮层/卡片融入背景 | 卡片用 bg-zinc-800 等略浅于背景,形成层级 |
| 字重问题 | 避免过细字体;粗体在暗底上略减重或提高对比度 |
| 图片/图形白底暴露 | 占位图、图标优先用透明背景 (SVG/PNG) |
| 用户无选择权 | 默认跟随系统,并在设置中提供「浅色 / 深色 / 跟随系统」 |
#18181b (zinc-900)#27272a (zinc-800)#3f3f46 (zinc-700)#3f3f46 / #52525b (zinc-700/600)text-zinc-900 或 text-black 保持可读性#a1a1aa (zinc-400)禁止:纯黑 #000、纯白 #fff 作为大面积背景或文字。
| 浅色类名 | 暗色变体 |
|----------|----------|
| bg-white | dark:bg-zinc-800 |
| bg-gray-50 | dark:bg-zinc-900 |
| bg-gray-100 | dark:bg-zinc-800 |
| text-gray-900 | dark:text-zinc-100 |
| text-gray-500 / text-gray-400 | dark:text-zinc-400 / dark:text-zinc-500 |
| border-gray-100 / border-gray-200 | dark:border-zinc-700 / dark:border-zinc-600 |
| bg-black/50(遮罩) | dark:bg-black/60 |
| hover:bg-gray-50 | dark:hover:bg-zinc-700 |
prefers-color-schemeindex.html 的 <head> 最前面加入内联脚本,首帧渲染前根据 localStorage 和 prefers-color-scheme 设置 html 的 dark class实现前:
darkMode: 'class'实现后:
tools
Guides Supabase usage in petconnect-app including MCP tool calls, migrations, RLS, and API layer conventions. Use when working with Supabase, executing SQL, applying migrations, list_tables, execute_sql, RLS policies, or database schema changes.
tools
项目仓库瘦身与规范。Use when cleaning repo, optimizing .gitignore, removing large files, or organizing project structure. 约定:脚本仅用 PowerShell / npm 跨平台命令,不生成 .sh 文件。
development
Generates professional README files by synthesizing standard-readme, Best-README-Template, Google styleguide, and GitHub best practices. Use when creating or redesigning README.md, documenting projects, or when the user asks for README templates or best practices.
development
专业处理 README 与部署文档。Use when writing README, deployment guides, environment variable docs, or project structure documentation. 约定:README 必须包含环境变量表、获取 API Key 的链接、部署步骤、项目结构。