跳到正文
Skillpedia
界面(UI/UX)48k · #4395

flat-design-2

它能做什么

本指南介绍如何制作网站和应用的“半扁平”设计风格。它使用纯色,并搭配非常柔和的阴影,以营造层次感和可交互的感觉。

适用场景

  • ✓当你想要现代、简洁的设计时。
  • ✓当你要制作看起来可以点击的按钮时。
  • ✓当你想让窗口之类的元素看起来微微浮起时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/design-it/flat-design-2/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/design-it/flat-design-2/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“设计一个半扁平风格的按钮。”

每周 5 个新技能,1 分钟读完。

工作原理

这种设计的做法是使用纯色,并添加非常柔和、扩散范围大的阴影。这样元素会带有一点立体感,但又不会太花哨。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Flat Design 2.0 (Semi-Flat)

"Flat aesthetics, but with subtle hints of physics to communicate interactability."

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

  1. Mostly Flat: The primary aesthetic remains 2D and solid.
  2. Subtle Elevation: Use extremely soft, large-spread shadows strictly to indicate interactable elements (buttons, floating action buttons) or layers (modals).
  3. Micro-Gradients: Occasional, barely noticeable linear gradients to prevent large surfaces from feeling dead.

Visual DNA

  • Colors: Pairs well with Warm Tech or Earth-Grounded Elegance.
  • Typography: Clean, readable sans-serifs.
  • Shadows: Shadows must be low opacity, high blur, and usually tinted with the background color, not pure black.

Web Implementation

  • CSS Example:
:root {
  --shadow-color: rgba(43, 48, 58, 0.08); /* Tinted shadow */
}

.flat2-card {
  background-color: var(--bg-primary);
  border-radius: 8px;
  padding: 32px;
  /* Very subtle, diffuse shadow */
  box-shadow: 0 10px 30px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flat2-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(43, 48, 58, 0.12);
}

.flat2-btn {
  background: var(--cta-highlight);
  border-radius: 4px;
  padding: 12px 24px;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

App Implementation

SwiftUI

struct SemiFlatCard: View {
    @State private var isPressed = false
    
    var body: some View {
        VStack(alignment: .leading, spacing: 16) {
            Text("Semi-Flat Card")
                .font(.system(size: 18, weight: .semibold))
            Text("Flat aesthetic with just enough depth to hint at interactivity.")
                .font(.system(size: 15))
                .foregroundColor(.secondary)
        }
        .padding(24)
        .background(Color(.systemBackground))
        .cornerRadius(8)
        // The key: very soft, tinted shadow — NOT harsh black
        .shadow(color: Color.black.opacity(0.06), radius: 12, x: 0, y: 4)
        .scaleEffect(isPressed ? 0.98 : 1.0)
        .animation(.easeOut(duration: 0.2), value: isPressed)
        .onLongPressGesture(minimumDuration: .infinity, pressing: { pressing in
            isPressed = pressing
        }, perform: {})
    }
}

struct SemiFlatButton: View {
    var body: some View {
        Button(action: {}) {
            Text("Continue")
                .font(.system(size: 15, weight: .semibold))
                .foregroundColor(.white)
                .padding(.horizontal, 24)
                .padding(.vertical, 12)
                .background(Color.accentColor)
                .cornerRadius(4)
                // Subtle button shadow
                .shadow(color: Color.accentColor.opacity(0.25), radius: 8, x: 0, y: 4)
        }
        .buttonStyle(.plain)
    }
}
  • Shadow color should be tinted (e.g., Color.accentColor.opacity(0.15)), never pure black.
  • Use radius: 10...16 with opacity: 0.05...0.08 — if you can immediately see the shadow, it's too heavy.
  • Add subtle scaleEffect on press to hint at physical feedback.

Flutter

class SemiFlatCard extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(24),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        // Very soft, tinted shadow
        boxShadow: [
          BoxShadow(
            color: const Color(0xFF2B303A).withOpacity(0.08),
            blurRadius: 24,
            offset: const Offset(0, 8),
            spreadRadius: 0,
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const Text('Semi-Flat Card',
            style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600)),
          const SizedBox(height: 16),
          const Text('Flat aesthetic with just enough depth to hint at interactivity.',
            style: TextStyle(fontSize: 15, color: Colors.black54)),
          const SizedBox(height: 20),
          ElevatedButton(
            onPressed: () {},
            style: ElevatedButton.styleFrom(

…
常见问题

“半扁平”是什么意思?

意思是设计整体上以扁平为主,但保留了一些细微的细节,比如淡淡的阴影,用来表明某个元素可以点击或触摸。

为什么要用细微的阴影?

细微的阴影能帮助用户理解界面,比如通过阴影显示哪些元素可以交互(如按钮),或者哪些元素处于上层(如弹出窗口)。

可以使用任意颜色吗?

可以。不过指南推荐“Warm Tech”和“Earth-Grounded Elegance”这两组配色,效果会更好。

详情

作者的原始描述

Web and App implementation guide for Flat Design 2.0 (Semi-Flat). Trigger when the user wants flat design with subtle shadows and improved usability.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4395
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能