Visual Designer by daffy0208/ai-dev-standards
npx skills add https://github.com/daffy0208/ai-dev-standards --skill 'Visual Designer'优秀的设计是无形的——用户只会在设计糟糕时注意到它,而不是在设计出色时。
一致性优于创造性。
视觉设计服务于用户体验。每一种颜色、字体和间距的决策都应有其目的。
色轮:
60-30-10 法则:
示例调色板:
/* 主色 (60%) - 背景,大面积区域 */
--color-primary-50: #eff6ff;
--color-primary-100: #dbeafe;
--color-primary-200: #bfdbfe;
--color-primary-500: #3b82f6; /* 主要品牌色 */
--color-primary-600: #2563eb;
--color-primary-900: #1e3a8a;
/* 辅色 (30%) - 补充元素 */
--color-secondary-500: #8b5cf6;
--color-secondary-600: #7c3aed;
/* 强调色 (10%) - 行动号召,高亮 */
--color-accent-500: #f59e0b;
--color-accent-600: #d97706;
/* 中性色 - 文本,边框 */
--color-gray-50: #f9fafb;
--color-gray-100: #f3f4f6;
--color-gray-300: #d1d5db;
--color-gray-500: #6b7280;
--color-gray-700: #374151;
--color-gray-900: #111827;
/* 语义化颜色 */
--color-success: #10b981;
--color-warning: #f59e0b;
--color-error: #ef4444;
--color-info: #3b82f6;
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
WCAG 要求:
普通文本 (< 18pt):对比度 4.5:1
大文本 (≥ 18pt 或 14pt 加粗):对比度 3:1
UI 组件:对比度 3:1
/* ✅ 良好:足够的对比度 (8:1) / .text { color: #111827; / gray-900 */ background: #ffffff; }
/* ❌ 差:对比度不足 (2.1:1) / .text-bad { color: #d1d5db; / gray-300 */ background: #ffffff; }
工具:
:root {
--bg-primary: #ffffff;
--bg-secondary: #f9fafb;
--text-primary: #111827;
--text-secondary: #6b7280;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-primary: #111827;
--bg-secondary: #1f2937;
--text-primary: #f9fafb;
--text-secondary: #9ca3af;
}
}
深色模式检查清单:
黄金法则: 最多使用 2 种字体
流行的配对:
/* 现代 & 简洁 */
--font-heading: 'Inter', sans-serif;
--font-body: 'Inter', sans-serif;
/* 经典 & 专业 */
--font-heading: 'Playfair Display', serif;
--font-body: 'Source Sans Pro', sans-serif;
/* 科技 & 极简 */
--font-heading: 'Space Grotesk', sans-serif;
--font-body: 'IBM Plex Sans', sans-serif;
/* 创意 & 友好 */
--font-heading: 'Poppins', sans-serif;
--font-body: 'Open Sans', sans-serif;
基础大小: 16px (1rem) 比例系数: 1.25 (大三度)
--text-xs: 0.64rem; /* 10.24px */
--text-sm: 0.8rem; /* 12.8px */
--text-base: 1rem; /* 16px */
--text-lg: 1.25rem; /* 20px */
--text-xl: 1.563rem; /* 25px */
--text-2xl: 1.953rem; /* 31.25px */
--text-3xl: 2.441rem; /* 39px */
--text-4xl: 3.052rem; /* 48.83px */
--text-5xl: 3.815rem; /* 61px */
/* 字体粗细 */
--font-normal: 400;
--font-medium: 500;
--font-semibold: 600;
--font-bold: 700;
/* 标题:较紧的行高 */
h1,
h2,
h3 {
line-height: 1.2;
}
/* 正文:舒适的阅读体验 */
p {
line-height: 1.6;
max-width: 65ch; /* 最大 65 个字符以保证可读性 */
}
/* 小号文本:更大的行高 */
.text-sm {
line-height: 1.8;
}
/* 字符间距 */
.heading {
letter-spacing: -0.02em; /* 更紧密 */
}
.uppercase {
letter-spacing: 0.05em; /* 全大写时更宽松 */
}
/* 流体排版 */
h1 {
font-size: clamp(2rem, 5vw, 3.5rem);
}
/* 或基于断点 */
h1 {
font-size: 2rem;
}
@media (min-width: 768px) {
h1 {
font-size: 3rem;
}
}
@media (min-width: 1024px) {
h1 {
font-size: 3.5rem;
}
}
为什么是 8pt?
大多数屏幕尺寸可被 8 整除
创造视觉节奏
更容易保持一致性
--space-1: 0.25rem; /* 4px / --space-2: 0.5rem; / 8px / --space-3: 0.75rem; / 12px / --space-4: 1rem; / 16px / --space-5: 1.25rem; / 20px / --space-6: 1.5rem; / 24px / --space-8: 2rem; / 32px / --space-10: 2.5rem; / 40px / --space-12: 3rem; / 48px / --space-16: 4rem; / 64px / --space-20: 5rem; / 80px / --space-24: 6rem; / 96px */
用法:
/* 组件内边距 */
.button {
padding: var(--space-3) var(--space-6); /* 12px 24px */
}
/* 区块间距 */
.section {
padding: var(--space-16) 0; /* 上下 64px */
}
/* 元素外边距 */
.heading {
margin-bottom: var(--space-4); /* 16px */
}
.paragraph {
margin-bottom: var(--space-6); /* 24px */
}
/* 一致的垂直间距 */
* + * {
margin-top: var(--space-4);
}
/* 特定覆盖 */
h1 + p {
margin-top: var(--space-6);
}
p + p {
margin-top: var(--space-4);
}
通过以下方式建立重要性:
/* 主标题 */
h1 {
font-size: var(--text-4xl);
font-weight: var(--font-bold);
color: var(--text-primary);
margin-bottom: var(--space-8);
}
/* 副标题 */
h2 {
font-size: var(--text-2xl);
font-weight: var(--font-semibold);
color: var(--text-primary);
margin-bottom: var(--space-4);
}
/* 正文 */
p {
font-size: var(--text-base);
font-weight: var(--font-normal);
color: var(--text-secondary);
margin-bottom: var(--space-4);
}
/* 辅助文本 */
.caption {
font-size: var(--text-sm);
color: var(--text-tertiary);
}
12 列网格:
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: var(--space-4);
}
/* 全宽 */
.col-12 {
grid-column: span 12;
}
/* 半宽 */
.col-6 {
grid-column: span 6;
}
/* 三分之一宽 */
.col-4 {
grid-column: span 4;
}
/* 响应式 */
@media (max-width: 768px) {
.col-6 {
grid-column: span 12; /* 在移动端堆叠 */
}
}
/* ❌ 拥挤 */
.card-bad {
padding: 8px;
}
/* ✅ 呼吸空间 */
.card-good {
padding: var(--space-8); /* 32px */
}
/* 内容间距 */
.content {
max-width: 1200px;
margin: 0 auto;
padding: 0 var(--space-4); /* 侧边内边距 */
}
/* 移动优先 */
:root {
--breakpoint-sm: 640px; /* 小设备 */
--breakpoint-md: 768px; /* 平板 */
--breakpoint-lg: 1024px; /* 笔记本电脑 */
--breakpoint-xl: 1280px; /* 台式机 */
--breakpoint-2xl: 1536px; /* 大屏幕 */
}
/* 用法 */
@media (min-width: 768px) {
.container {
padding: var(--space-8);
}
}
/* 层级 */
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
/* 用法 */
.card {
box-shadow: var(--shadow-md);
transition: box-shadow 0.2s;
}
.card:hover {
box-shadow: var(--shadow-lg);
}
--radius-sm: 0.25rem; /* 4px - 小元素 */
--radius-md: 0.5rem; /* 8px - 按钮,输入框 */
--radius-lg: 0.75rem; /* 12px - 卡片 */
--radius-xl: 1rem; /* 16px - 模态框 */
--radius-full: 9999px; /* 完全圆角 */
/* 用法 */
.button {
border-radius: var(--radius-md);
}
.avatar {
border-radius: var(--radius-full);
}
/* 过渡时长 */
--transition-fast: 150ms;
--transition-base: 200ms;
--transition-slow: 300ms;
/* 缓动函数 */
--ease-in: cubic-bezier(0.4, 0, 1, 1);
--ease-out: cubic-bezier(0, 0, 0.2, 1);
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
/* 按钮悬停 */
.button {
transition: all var(--transition-base) var(--ease-in-out);
}
.button:hover {
transform: translateY(-1px);
box-shadow: var(--shadow-lg);
}
/* 淡入 */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.fade-in {
animation: fadeIn var(--transition-slow) var(--ease-out);
}
在元素之间创造清晰的区分
/* ✅ 良好对比 */
.hero {
background: var(--color-primary-600);
color: white;
}
/* ❌ 对比度差 */
.hero-bad {
background: #ddd;
color: #aaa;
}
对齐元素以创造秩序
/* ✅ 对齐 */
.container {
display: flex;
align-items: center;
justify-content: space-between;
}
重复视觉元素以保持一致性
/* 一致的按钮样式 */
.button {
padding: var(--space-3) var(--space-6);
border-radius: var(--radius-md);
font-weight: var(--font-semibold);
}
将相关元素分组
/* 表单字段分组 */
.form-group {
display: flex;
flex-direction: column;
gap: var(--space-2);
margin-bottom: var(--space-6);
}
/* 主按钮 */
.btn-primary {
background: var(--color-primary-600);
color: white;
padding: var(--space-3) var(--space-6);
border-radius: var(--radius-md);
font-weight: var(--font-semibold);
border: none;
cursor: pointer;
transition: all var(--transition-base);
}
.btn-primary:hover {
background: var(--color-primary-700);
transform: translateY(-1px);
box-shadow: var(--shadow-md);
}
/* 次按钮 */
.btn-secondary {
background: transparent;
color: var(--color-primary-600);
border: 2px solid var(--color-primary-600);
}
/* 幽灵按钮 */
.btn-ghost {
background: transparent;
color: var(--text-primary);
}
.btn-ghost:hover {
background: var(--color-gray-100);
}
.card {
background: white;
border-radius: var(--radius-lg);
padding: var(--space-6);
box-shadow: var(--shadow-md);
transition: all var(--transition-base);
}
.card:hover {
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
}
.input {
width: 100%;
padding: var(--space-3) var(--space-4);
border: 2px solid var(--color-gray-300);
border-radius: var(--radius-md);
font-size: var(--text-base);
transition: border-color var(--transition-base);
}
.input:focus {
outline: none;
border-color: var(--color-primary-500);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.input:invalid {
border-color: var(--color-error);
}
技能:
design-system-architect - 构建设计系统ux-designer - 用户体验设计accessibility-engineer - 色彩对比度,可读性外部资源:
好的设计让产品易于使用。伟大的设计让它消失。 🎨
每周安装
0
仓库
GitHub 星标
18
首次出现
1970年1月1日
安全审计
Great design is invisible - users notice when it's bad, not when it's good.
Consistency over creativity.
Visual design serves the user experience. Every color, font, and spacing decision should have a purpose.
Color Wheel:
60-30-10 Rule:
Example Palette:
/* Primary (60%) - Backgrounds, large areas */
--color-primary-50: #eff6ff;
--color-primary-100: #dbeafe;
--color-primary-200: #bfdbfe;
--color-primary-500: #3b82f6; /* Main brand color */
--color-primary-600: #2563eb;
--color-primary-900: #1e3a8a;
/* Secondary (30%) - Complementary elements */
--color-secondary-500: #8b5cf6;
--color-secondary-600: #7c3aed;
/* Accent (10%) - CTAs, highlights */
--color-accent-500: #f59e0b;
--color-accent-600: #d97706;
/* Neutrals - Text, borders */
--color-gray-50: #f9fafb;
--color-gray-100: #f3f4f6;
--color-gray-300: #d1d5db;
--color-gray-500: #6b7280;
--color-gray-700: #374151;
--color-gray-900: #111827;
/* Semantic colors */
--color-success: #10b981;
--color-warning: #f59e0b;
--color-error: #ef4444;
--color-info: #3b82f6;
WCAG Requirements:
Normal text (< 18pt): 4.5:1 contrast ratio
Large text (≥ 18pt or 14pt bold): 3:1 contrast ratio
UI components: 3:1 contrast ratio
/* ✅ Good: Sufficient contrast (8:1) / .text { color: #111827; / gray-900 */ background: #ffffff; }
/* ❌ Bad: Insufficient contrast (2.1:1) / .text-bad { color: #d1d5db; / gray-300 */ background: #ffffff; }
Tools:
:root {
--bg-primary: #ffffff;
--bg-secondary: #f9fafb;
--text-primary: #111827;
--text-secondary: #6b7280;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-primary: #111827;
--bg-secondary: #1f2937;
--text-primary: #f9fafb;
--text-secondary: #9ca3af;
}
}
Dark Mode Checklist:
Golden Rule: Maximum 2 fonts
Popular Pairings:
/* Modern & Clean */
--font-heading: 'Inter', sans-serif;
--font-body: 'Inter', sans-serif;
/* Classic & Professional */
--font-heading: 'Playfair Display', serif;
--font-body: 'Source Sans Pro', sans-serif;
/* Tech & Minimal */
--font-heading: 'Space Grotesk', sans-serif;
--font-body: 'IBM Plex Sans', sans-serif;
/* Creative & Friendly */
--font-heading: 'Poppins', sans-serif;
--font-body: 'Open Sans', sans-serif;
Base size: 16px (1rem) Scale ratio: 1.25 (Major Third)
--text-xs: 0.64rem; /* 10.24px */
--text-sm: 0.8rem; /* 12.8px */
--text-base: 1rem; /* 16px */
--text-lg: 1.25rem; /* 20px */
--text-xl: 1.563rem; /* 25px */
--text-2xl: 1.953rem; /* 31.25px */
--text-3xl: 2.441rem; /* 39px */
--text-4xl: 3.052rem; /* 48.83px */
--text-5xl: 3.815rem; /* 61px */
/* Font weights */
--font-normal: 400;
--font-medium: 500;
--font-semibold: 600;
--font-bold: 700;
/* Headings: Tighter line-height */
h1,
h2,
h3 {
line-height: 1.2;
}
/* Body text: Comfortable reading */
p {
line-height: 1.6;
max-width: 65ch; /* 65 characters max for readability */
}
/* Small text: More line-height */
.text-sm {
line-height: 1.8;
}
/* Letter spacing */
.heading {
letter-spacing: -0.02em; /* Tighter */
}
.uppercase {
letter-spacing: 0.05em; /* Wider for all-caps */
}
/* Fluid typography */
h1 {
font-size: clamp(2rem, 5vw, 3.5rem);
}
/* Or breakpoint-based */
h1 {
font-size: 2rem;
}
@media (min-width: 768px) {
h1 {
font-size: 3rem;
}
}
@media (min-width: 1024px) {
h1 {
font-size: 3.5rem;
}
}
Why 8pt?
Most screens are divisible by 8
Creates visual rhythm
Easier to maintain consistency
--space-1: 0.25rem; /* 4px / --space-2: 0.5rem; / 8px / --space-3: 0.75rem; / 12px / --space-4: 1rem; / 16px / --space-5: 1.25rem; / 20px / --space-6: 1.5rem; / 24px / --space-8: 2rem; / 32px / --space-10: 2.5rem; / 40px / --space-12: 3rem; / 48px / --space-16: 4rem; / 64px / --space-20: 5rem; / 80px / --space-24: 6rem; / 96px */
Usage:
/* Component padding */
.button {
padding: var(--space-3) var(--space-6); /* 12px 24px */
}
/* Section spacing */
.section {
padding: var(--space-16) 0; /* 64px top/bottom */
}
/* Element margins */
.heading {
margin-bottom: var(--space-4); /* 16px */
}
.paragraph {
margin-bottom: var(--space-6); /* 24px */
}
/* Consistent vertical spacing */
* + * {
margin-top: var(--space-4);
}
/* Specific overrides */
h1 + p {
margin-top: var(--space-6);
}
p + p {
margin-top: var(--space-4);
}
Establish importance through:
/* Primary heading */
h1 {
font-size: var(--text-4xl);
font-weight: var(--font-bold);
color: var(--text-primary);
margin-bottom: var(--space-8);
}
/* Secondary heading */
h2 {
font-size: var(--text-2xl);
font-weight: var(--font-semibold);
color: var(--text-primary);
margin-bottom: var(--space-4);
}
/* Body text */
p {
font-size: var(--text-base);
font-weight: var(--font-normal);
color: var(--text-secondary);
margin-bottom: var(--space-4);
}
/* Supporting text */
.caption {
font-size: var(--text-sm);
color: var(--text-tertiary);
}
12-Column Grid:
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: var(--space-4);
}
/* Full width */
.col-12 {
grid-column: span 12;
}
/* Half width */
.col-6 {
grid-column: span 6;
}
/* Third width */
.col-4 {
grid-column: span 4;
}
/* Responsive */
@media (max-width: 768px) {
.col-6 {
grid-column: span 12; /* Stack on mobile */
}
}
/* ❌ Cramped */
.card-bad {
padding: 8px;
}
/* ✅ Breathing room */
.card-good {
padding: var(--space-8); /* 32px */
}
/* Content spacing */
.content {
max-width: 1200px;
margin: 0 auto;
padding: 0 var(--space-4); /* Side padding */
}
/* Mobile first */
:root {
--breakpoint-sm: 640px; /* Small devices */
--breakpoint-md: 768px; /* Tablets */
--breakpoint-lg: 1024px; /* Laptops */
--breakpoint-xl: 1280px; /* Desktops */
--breakpoint-2xl: 1536px; /* Large screens */
}
/* Usage */
@media (min-width: 768px) {
.container {
padding: var(--space-8);
}
}
/* Elevation levels */
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
/* Usage */
.card {
box-shadow: var(--shadow-md);
transition: box-shadow 0.2s;
}
.card:hover {
box-shadow: var(--shadow-lg);
}
--radius-sm: 0.25rem; /* 4px - small elements */
--radius-md: 0.5rem; /* 8px - buttons, inputs */
--radius-lg: 0.75rem; /* 12px - cards */
--radius-xl: 1rem; /* 16px - modals */
--radius-full: 9999px; /* Fully rounded */
/* Usage */
.button {
border-radius: var(--radius-md);
}
.avatar {
border-radius: var(--radius-full);
}
/* Transition timing */
--transition-fast: 150ms;
--transition-base: 200ms;
--transition-slow: 300ms;
/* Easing functions */
--ease-in: cubic-bezier(0.4, 0, 1, 1);
--ease-out: cubic-bezier(0, 0, 0.2, 1);
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
/* Button hover */
.button {
transition: all var(--transition-base) var(--ease-in-out);
}
.button:hover {
transform: translateY(-1px);
box-shadow: var(--shadow-lg);
}
/* Fade in */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.fade-in {
animation: fadeIn var(--transition-slow) var(--ease-out);
}
Create clear distinction between elements
/* ✅ Good contrast */
.hero {
background: var(--color-primary-600);
color: white;
}
/* ❌ Poor contrast */
.hero-bad {
background: #ddd;
color: #aaa;
}
Align elements to create order
/* ✅ Aligned */
.container {
display: flex;
align-items: center;
justify-content: space-between;
}
Repeat visual elements for consistency
/* Consistent button styles */
.button {
padding: var(--space-3) var(--space-6);
border-radius: var(--radius-md);
font-weight: var(--font-semibold);
}
Group related elements
/* Form fields grouped */
.form-group {
display: flex;
flex-direction: column;
gap: var(--space-2);
margin-bottom: var(--space-6);
}
/* Primary button */
.btn-primary {
background: var(--color-primary-600);
color: white;
padding: var(--space-3) var(--space-6);
border-radius: var(--radius-md);
font-weight: var(--font-semibold);
border: none;
cursor: pointer;
transition: all var(--transition-base);
}
.btn-primary:hover {
background: var(--color-primary-700);
transform: translateY(-1px);
box-shadow: var(--shadow-md);
}
/* Secondary button */
.btn-secondary {
background: transparent;
color: var(--color-primary-600);
border: 2px solid var(--color-primary-600);
}
/* Ghost button */
.btn-ghost {
background: transparent;
color: var(--text-primary);
}
.btn-ghost:hover {
background: var(--color-gray-100);
}
.card {
background: white;
border-radius: var(--radius-lg);
padding: var(--space-6);
box-shadow: var(--shadow-md);
transition: all var(--transition-base);
}
.card:hover {
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
}
.input {
width: 100%;
padding: var(--space-3) var(--space-4);
border: 2px solid var(--color-gray-300);
border-radius: var(--radius-md);
font-size: var(--text-base);
transition: border-color var(--transition-base);
}
.input:focus {
outline: none;
border-color: var(--color-primary-500);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.input:invalid {
border-color: var(--color-error);
}
Skills:
design-system-architect - Building design systemsux-designer - User experience designaccessibility-engineer - Color contrast, readabilityExternal:
Good design makes the product easy to use. Great design makes it disappear. 🎨
Weekly Installs
0
Repository
GitHub Stars
18
First Seen
Jan 1, 1970
Security Audits
前端设计技能指南:避免AI垃圾美学,打造独特生产级界面
38,200 周安装
data-driven-testing 测试技能已弃用 | 测试最佳实践替代方案 | 0xbigboss/claude-code
59 周安装
1Password CLI安全使用指南:op-cli命令最佳实践与密钥管理技巧
63 周安装
E2E测试完整指南:分类、修复原则与工作流程 | 端到端测试最佳实践
63 周安装
Docker与Kubernetes容器编排最佳实践 | Dockerfile优化、Docker Compose配置、K8s部署指南
70 周安装
tmux进程管理最佳实践 - 会话复用规则与自动化脚本教程
82 周安装
Codex子代理使用指南:AI编程助手参数配置、上下文收集与任务执行教程
86 周安装