material-design
它能做什么
这份指南可以帮你按照谷歌的视觉风格(即 Material Design)来设计应用和网站界面。它基于层级(阴影)、动效和标准化组件等理念。
适用场景
- ✓当你希望你的应用或网站拥有谷歌的外观和风格时。
- ✓当你要设计一个用阴影来体现层级关系的界面时。
- ✓如果你需要能够平滑引导用户操作的动画时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/design-it/material-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我创建一个 Material Design 风格的按钮。”
每周 5 个新技能,1 分钟读完。
工作原理
Material Design 把界面看作“数字纸张”,通过阴影营造纵深感。它还规定了颜色、字体(比如 Roboto)和形状的使用方式,让整体体验保持一致。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Material Design
"Digital paper and ink. Interfaces built on the physical properties of stacked material."
When to Use
Use this sub-style when the user's request matches the aesthetic described above. This is a child reference of the design-it skill and is not meant to be triggered directly.
Core Principles
- Z-Axis Elevation: Everything exists on a specific layer. Shadows communicate hierarchy and state.
- Meaningful Motion: Animations are continuous, guiding the user's focus from one state to the next (e.g., ripple effects, shared element transitions).
- Structured Layout: Strict adherence to an 8dp baseline grid and specific component anatomies (cards, FABs, app bars).
Visual DNA
- Colors: Works excellently with Desert Mirage or Minimalist Slate. Utilize primary, secondary, surface, and error semantic mapping.
- Typography:
RobotoorGoogle Sans(or equivalent clean geometric sans). Stick strictly to the Material Type Scale (H1-H6, Subtitle, Body, Caption, Overline). - Shapes: Moderately rounded corners (4px to 16px).
Web Implementation
- Do not reinvent the wheel: mimic standard Material elevations.
- CSS Example:
.material-card {
background: var(--bg-surface);
border-radius: 8px;
padding: 16px;
/* Material Elevation 2 */
box-shadow: 0 3px 1px -2px rgba(0,0,0,0.2),
0 2px 2px 0 rgba(0,0,0,0.14),
0 1px 5px 0 rgba(0,0,0,0.12);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.material-btn {
text-transform: uppercase;
font-weight: 500;
letter-spacing: 1.25px;
padding: 0 16px;
height: 36px;
border-radius: 4px;
background: var(--cta-highlight);
color: #fff;
border: none;
/* Ripple effect is usually handled via JS, but structure is key */
}
App Implementation
SwiftUI
struct MaterialCard: View {
var body: some View {
VStack(alignment: .leading, spacing: 12) {
Text("Material Card")
.font(.system(size: 20, weight: .medium))
Text("Digital paper and ink. Shadows communicate where this surface sits.")
.font(.system(size: 14))
.foregroundColor(.secondary)
HStack {
Spacer()
Button("ACTION") {}
.font(.system(size: 14, weight: .medium))
.foregroundColor(.accentColor)
.padding(.horizontal, 12)
.padding(.vertical, 8)
}
}
.padding(16)
.background(Color(.systemBackground))
.cornerRadius(8)
// Material Elevation 2 equivalent
.shadow(color: Color.black.opacity(0.12), radius: 3, x: 0, y: 1)
.shadow(color: Color.black.opacity(0.08), radius: 2, x: 0, y: 2)
}
}
// Material FAB
struct MaterialFAB: View {
var body: some View {
Button(action: {}) {
Image(systemName: "plus")
.font(.system(size: 24))
.foregroundColor(.white)
.frame(width: 56, height: 56)
.background(Color.accentColor)
.cornerRadius(16)
.shadow(color: Color.black.opacity(0.2), radius: 6, x: 0, y: 3)
.shadow(color: Color.black.opacity(0.14), radius: 4, x: 0, y: 2)
}
}
}
- Emulate Material elevation levels by stacking multiple
.shadow()modifiers at different blur/offset values. - Use
.cornerRadius(8...16)— Material Design 3 uses more rounded shapes than M2. - Animate shadow changes using
.animation(.easeInOut(duration: 0.28))— Material uses 280ms transitions.
Flutter
// Flutter IS Material Design — use it natively
class MaterialScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: const Color(0xFF6750A4), // Material You seed
// Map your universal palette here
),
home: Scaffold(
appBar: AppBar(
title: const Text('Material Design'),
// M3 appbar elevation is 0 by default, scrolled = 3
),
body: Padding(
padding: const EdgeInsets.all(16),
child: Card(
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16),
…
常见问题
什么是“Z 轴高度”?
指屏幕上的元素处于不同的“高度”或“层级”,并通过阴影来表示。这样可以帮助突出最重要的内容。
什么是“有意义的动效”?
指用来引导用户视线从一个位置移动到另一个位置的动画,比如你点击某个元素时出现的“水波纹”效果。
什么是“结构化布局”?
这是一套组织屏幕元素的规则,它使用网格以及卡片、悬浮操作按钮等预设组件,以确保界面风格统一。
详情
作者的原始描述
Web and App implementation guide for Material Design. Trigger when user wants Google's aesthetic, elevation, motion, and consistent components.
热度
- GitHub 星标
- 48k
- 排名
- #4405
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。