music-theory-visual-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMusic Theory Visual Design
音乐理论应用视觉设计
Overview
概述
This skill provides visual design guidelines for building UI components in the music theory application. It ensures consistent typography, color usage, spacing, and animations across all components while maintaining the application's distinctive aesthetic: modern, clean, with musical sophistication.
本指南为音乐理论应用的UI组件构建提供视觉设计规范,确保所有组件在排版、色彩使用、间距和动画上保持一致性,同时保留应用独特的美学风格:现代、简洁且兼具音乐质感。
Design Philosophy
设计理念
Create interfaces that balance professional elegance with approachability. Think "concert hall meets digital instrument." Prioritize visual clarity while incorporating subtle musical character through the custom color system.
打造兼具专业优雅与亲和力的界面,想象「音乐厅邂逅数字化乐器」的场景。在通过自定义色彩系统融入微妙音乐特质的同时,优先保证视觉清晰度。
Typography
排版规范
Font Families:
- Use (Noto Sans JP) for UI elements
font-sans - Use (Noto Serif JP) sparingly for decorative text
font-serif
Weight Contrast:
- Headings: (700) or
font-bold(800)font-extrabold - Body text: (400) or
font-normal(300)font-light - Emphasis: Extreme contrast (e.g., (200) paired with
font-extralight(900))font-black
Size Hierarchy:
- Small labels: (0.75rem)
text-xs - Standard text: (0.875rem)
text-sm - Headings: (1rem) →
text-base→text-lgtext-xl
字体家族:
- UI元素使用(Noto Sans JP)
font-sans - 装饰性文本少量使用(Noto Serif JP)
font-serif
字重对比:
- 标题:(700)或
font-bold(800)font-extrabold - 正文:(400)或
font-normal(300)font-light - 强调内容:极端对比(例如(200)搭配
font-extralight(900))font-black
尺寸层级:
- 小标签:(0.75rem)
text-xs - 标准文本:(0.875rem)
text-sm - 标题:(1rem)→
text-base→text-lgtext-xl
Color System
色彩系统
Use CSS Variables (not hex codes):
- Backgrounds: ,
bg-background,bg-cardbg-panel - Text: ,
text-foregroundtext-muted-foreground - Borders:
border-border - Interactive: ,
bg-accenttext-accent-foreground - Selected:
bg-selected
Musical Color System (84 colors):
- For pitch-specific elements: ,
bg-key-c-lydiantext-key-g-dorian - Pattern: (12 pitches × 7 modes)
bg-key-{pitch}-{mode} - Use sparingly for music-theory-specific visualizations
Transparency for Layering:
- Subtle overlays: ,
bg-white/10bg-black/5 - Hover states:
hover:bg-white/25 - Selected states:
bg-white/50
使用CSS变量(而非十六进制代码):
- 背景色:、
bg-background、bg-cardbg-panel - 文本色:、
text-foregroundtext-muted-foreground - 边框色:
border-border - 交互元素:、
bg-accenttext-accent-foreground - 选中状态:
bg-selected
音乐色彩系统(84种颜色):
- 音高专属元素使用:、
bg-key-c-lydiantext-key-g-dorian - 命名规则:(12种音高 × 7种调式)
bg-key-{pitch}-{mode} - 仅在音乐理论相关可视化场景中少量使用
分层透明度设置:
- 微妙叠加层:、
bg-white/10bg-black/5 - 悬停状态:
hover:bg-white/25 - 选中状态:
bg-white/50
Spacing & Layout
间距与布局
Consistent Spacing:
- Internal padding: (16px) standard
p-4 - Vertical stacking:
space-y-4 - Grid gaps:
gap-4
Common Patterns:
- Card:
bg-card border border-border rounded-lg p-4 shadow-sm - Panel:
bg-panel space-y-4 - Full-height content:
h-[var(--content-height-full)]
Responsive:
- Mobile-first: Apply styles without prefix
- Desktop: Use prefix (768px+)
md:
统一间距规范:
- 内部内边距:标准为(16px)
p-4 - 垂直堆叠:
space-y-4 - 网格间距:
gap-4
常见布局模式:
- 卡片:
bg-card border border-border rounded-lg p-4 shadow-sm - 面板:
bg-panel space-y-4 - 全屏内容:
h-[var(--content-height-full)]
响应式设计:
- 移动端优先:无需前缀即可应用样式
- 桌面端:使用前缀(适配768px及以上屏幕)
md:
Animation & Motion
动画与动效
Framer Motion Basics:
tsx
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3 }}
>Hover Effects:
- Subtle:
hover:bg-accent hover:text-accent-foreground transition-colors - Scale:
hover:scale-105 transition-transform
State Transitions:
- Always use or
transition-colorsfor smooth changestransition-transform - Keep durations short (0.2-0.3s)
Framer Motion基础用法:
tsx
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3 }}
>悬停效果:
- 微妙变化:
hover:bg-accent hover:text-accent-foreground transition-colors - 缩放效果:
hover:scale-105 transition-transform
状态过渡:
- 状态变化时始终使用或
transition-colors实现平滑过渡transition-transform - 过渡时长保持较短(0.2-0.3秒)
Tailwind CSS Conventions
Tailwind CSS 约定
className Management:
- Always use for component className props:
twMergetsxclassName={twMerge('bg-card border rounded p-4', className)} - Add only when conditional logic is needed:
clsxtsxclassName={twMerge(clsx('base', isActive && 'text-primary'), className)}
Responsibility Separation:
- Parent (external): Size (,
w-), position (h-,m-), responsive (p-)md: - Child (internal): Appearance (,
bg-,text-), internal layout (border-,flex)grid
Example Component:
tsx
interface ComponentProps {
className?: string;
}
export const Component: React.FC<ComponentProps> = ({ className }) => {
return <div className={twMerge('bg-card rounded-lg border p-4', className)}>{/* content */}</div>;
};className管理:
- 组件的className属性始终使用:
twMergetsxclassName={twMerge('bg-card border rounded p-4', className)} - 仅当需要条件逻辑时添加:
clsxtsxclassName={twMerge(clsx('base', isActive && 'text-primary'), className)}
职责分离:
- 父组件(外部):尺寸(、
w-)、定位(h-、m-)、响应式(p-)md: - 子组件(内部):外观(、
bg-、text-)、内部布局(border-、flex)grid
组件示例:
tsx
interface ComponentProps {
className?: string;
}
export const Component: React.FC<ComponentProps> = ({ className }) => {
return <div className={twMerge('bg-card rounded-lg border p-4', className)}>{/* content */}</div>;
};Accessibility
无障碍设计
Color Contrast:
- Maintain WCAG AA (4.5:1 for text)
- The defined CSS variables already meet this standard
Focus States:
- Visible focus:
focus:ring-2 focus:ring-primary - Outline alternative:
focus:outline-2 focus:outline-accent
Visual Feedback:
- Hover:
hover:bg-accent - Active:
active:scale-95 - Disabled:
disabled:opacity-50 disabled:cursor-not-allowed
色彩对比度:
- 符合WCAG AA标准(文本对比度4.5:1)
- 已定义的CSS变量均满足该标准
焦点状态:
- 可见焦点:
focus:ring-2 focus:ring-primary - 替代轮廓:
focus:outline-2 focus:outline-accent
视觉反馈:
- 悬停:
hover:bg-accent - 激活:
active:scale-95 - 禁用:
disabled:opacity-50 disabled:cursor-not-allowed