Best fit
- iOS 26 液态玻璃设计系统 — 适用于 SwiftUI、UIKit 和 WidgetKit 的动态玻璃材质,具有模糊、反射和交互式变形效果。
affaan-m/ECC
iOS 26 液态玻璃设计系统 — 适用于 SwiftUI、UIKit 和 WidgetKit 的动态玻璃材质,具有模糊、反射和交互式变形效果。
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/liquid-glass-design"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
According to the pinned SKILL.md from affaan-m/ECC: 实现苹果 Liquid Glass 的模式指南——这是一种动态材质,会模糊其后的内容,反射周围内容的颜色和光线,并对触摸和指针交互做出反应。涵盖 SwiftUI、UIKit 和 WidgetKit 集成。
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/liquid-glass-design"Best fit
Bring this context
Expected outputs
Key source sections
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
为 iOS 26+ 构建或更新采用新设计语言的应用程序时 实现玻璃风格的按钮、卡片、工具栏或容器时 在玻璃元素之间创建变形过渡时 将 Liquid Glass 效果应用于小组件时 将现有的模糊/材质效果迁移到新的 Liquid Glass API 时
为任何视图添加 Liquid Glass 的最简单方法:
为任何视图添加 Liquid Glass 的最简单方法:
.regular — 标准玻璃效果 .tint(Color) — 添加颜色色调以增强突出度 .interactive() — 对触摸和指针交互做出反应 形状:.capsule(默认)、.rect(cornerRadius:)、.circle
Review the “玻璃按钮样式” section in the pinned source before continuing.
SkillSignal prompt templates
These prompts were written by SkillSignal from the source structure; they are not upstream text.
Task-start prompt
Confirm source fit, inputs, and outputs before acting.
Use liquid-glass-design to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.
Source-guided execution
Make the Agent explicitly follow the key extracted sections.
Apply the pinned liquid-glass-design source to [task]. Pay particular attention to these source sections: “何时启用”, “核心模式 — SwiftUI”, “基本玻璃效果”, “自定义形状和色调”, “玻璃按钮样式”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].
Result-review prompt
Check omissions, permissions, and source drift before delivery.
Review the current liquid-glass-design result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.
Output checklist
The task matches the purpose documented in the SKILL.md.
The source section “何时启用” has been checked.
The source section “核心模式 — SwiftUI” has been checked.
The source section “基本玻璃效果” has been checked.
The source section “自定义形状和色调” has been checked.
Inputs, constraints, and acceptance criteria are explicit.
Unverified facts, compatibility, and outcome claims are clearly marked.
Any file, command, network, or data action has been reviewed.
Choose a different workflow
iOS 26 Liquid Glass design system — dynamic glass material with blur, reflection, and interactive morphing for SwiftUI, UIKit, and WidgetKit.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detail日本語翻訳:このファイルは liquid-glass-design 用の日本語翻訳が必要です
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailUse when the user wants professional brand-quality product images via Higgsfield's mode-specific prompt enhancement pipeline. Entry point for any product visual with a specific format or platform target. Use whenever: "product photoshoot", "lifestyle product shots", "Pinterest pin", "hero banner", "ad pack", "virtual try-on", "studio shot", "carousel images", "Meta ads creative", "model wearing product", "levitating product", "splash shot", "CGI style product", "restyle product image", Shopify i
A separate implementation from MoizIbnYousaf/marketing-cli; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
实现苹果 Liquid Glass 的模式指南——这是一种动态材质,会模糊其后的内容,反射周围内容的颜色和光线,并对触摸和指针交互做出反应。涵盖 SwiftUI、UIKit 和 WidgetKit 集成。
The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/liquid-glass-design". Inspect the command and pinned source before running it.
No dedicated Agent platform is declared in the pinned source record.
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
iOS 26 Liquid Glass design system — dynamic glass material with blur, reflection, and interactive morphing for SwiftUI, UIKit, and WidgetKit.
日本語翻訳:このファイルは liquid-glass-design 用の日本語翻訳が必要です
Use when the user wants professional brand-quality product images via Higgsfield's mode-specific prompt enhancement pipeline. Entry point for any product visual with a specific format or platform target. Use whenever: "product photoshoot", "lifestyle product shots", "Pinterest pin", "hero banner", "ad pack", "virtual try-on", "studio shot", "carousel images", "Meta ads creative", "model wearing product", "levitating product", "splash shot", "CGI style product", "restyle product image", Shopify i
Workflow for building and modifying content management systems across WordPress, Shopify, Wix, Squarespace, Drupal, WooCommerce, Joomla, HubSpot CMS Hub, Webflow, Adobe Experience Manager, and similar platforms. Use when working on CMS themes, plugins, apps, modules, admin panels, media uploads, content models, editors, markdown pipelines, or static export workflows.
Builds and debugs Shopify themes (.liquid files, theme.json, sections), develops custom Shopify apps (shopify.app.toml, OAuth, webhooks), and implements Storefront API integrations for headless storefronts. Use when building or customizing Shopify themes, creating Hydrogen or custom React storefronts, developing Shopify apps, implementing checkout UI extensions or Shopify Functions, optimizing performance, or integrating third-party services. Invoke for Liquid templating, Storefront API, app dev
实现苹果 Liquid Glass 的模式指南——这是一种动态材质,会模糊其后的内容,反射周围内容的颜色和光线,并对触摸和指针交互做出反应。涵盖 SwiftUI、UIKit 和 WidgetKit 集成。
为任何视图添加 Liquid Glass 的最简单方法:
Text("Hello, World!")
.font(.title)
.padding()
.glassEffect() // Default: regular variant, capsule shape
Text("Hello, World!")
.font(.title)
.padding()
.glassEffect(.regular.tint(.orange).interactive(), in: .rect(cornerRadius: 16.0))
关键自定义选项:
.regular — 标准玻璃效果.tint(Color) — 添加颜色色调以增强突出度.interactive() — 对触摸和指针交互做出反应.capsule(默认)、.rect(cornerRadius:)、.circleButton("Click Me") { /* action */ }
.buttonStyle(.glass)
Button("Important") { /* action */ }
.buttonStyle(.glassProminent)
出于性能和变形考虑,始终将多个玻璃视图包装在一个容器中:
GlassEffectContainer(spacing: 40.0) {
HStack(spacing: 40.0) {
Image(systemName: "scribble.variable")
.frame(width: 80.0, height: 80.0)
.font(.system(size: 36))
.glassEffect()
Image(systemName: "eraser.fill")
.frame(width: 80.0, height: 80.0)
.font(.system(size: 36))
.glassEffect()
}
}
spacing 参数控制合并距离——距离更近的元素会将其玻璃形状融合在一起。
使用 glassEffectUnion 将多个视图组合成单个玻璃形状:
@Namespace private var namespace
GlassEffectContainer(spacing: 20.0) {
HStack(spacing: 20.0) {
ForEach(symbolSet.indices, id: \.self) { item in
Image(systemName: symbolSet[item])
.frame(width: 80.0, height: 80.0)
.glassEffect()
.glassEffectUnion(id: item < 2 ? "group1" : "group2", namespace: namespace)
}
}
}
在玻璃元素出现/消失时创建平滑的变形效果:
@State private var isExpanded = false
@Namespace private var namespace
GlassEffectContainer(spacing: 40.0) {
HStack(spacing: 40.0) {
Image(systemName: "scribble.variable")
.frame(width: 80.0, height: 80.0)
.glassEffect()
.glassEffectID("pencil", in: namespace)
if isExpanded {
Image(systemName: "eraser.fill")
.frame(width: 80.0, height: 80.0)
.glassEffect()
.glassEffectID("eraser", in: namespace)
}
}
}
Button("Toggle") {
withAnimation { isExpanded.toggle() }
}
.buttonStyle(.glass)
要允许水平滚动内容延伸到侧边栏或检查器下方,请确保 ScrollView 内容到达容器的 leading/trailing 边缘。当布局延伸到边缘时,系统会自动处理侧边栏下方的滚动行为——无需额外的修饰符。
let glassEffect = UIGlassEffect()
glassEffect.tintColor = UIColor.systemBlue.withAlphaComponent(0.3)
glassEffect.isInteractive = true
let visualEffectView = UIVisualEffectView(effect: glassEffect)
visualEffectView.translatesAutoresizingMaskIntoConstraints = false
visualEffectView.layer.cornerRadius = 20
visualEffectView.clipsToBounds = true
view.addSubview(visualEffectView)
NSLayoutConstraint.activate([
visualEffectView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
visualEffectView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
visualEffectView.widthAnchor.constraint(equalToConstant: 200),
visualEffectView.heightAnchor.constraint(equalToConstant: 120)
])
// Add content to contentView
let label = UILabel()
label.text = "Liquid Glass"
label.translatesAutoresizingMaskIntoConstraints = false
visualEffectView.contentView.addSubview(label)
NSLayoutConstraint.activate([
label.centerXAnchor.constraint(equalTo: visualEffectView.contentView.centerXAnchor),
label.centerYAnchor.constraint(equalTo: visualEffectView.contentView.centerYAnchor)
])
let containerEffect = UIGlassContainerEffect()
containerEffect.spacing = 40.0
let containerView = UIVisualEffectView(effect: containerEffect)
let firstGlass = UIVisualEffectView(effect: UIGlassEffect())
let secondGlass = UIVisualEffectView(effect: UIGlassEffect())
containerView.contentView.addSubview(firstGlass)
containerView.contentView.addSubview(secondGlass)
scrollView.topEdgeEffect.style = .automatic
scrollView.bottomEdgeEffect.style = .hard
scrollView.leftEdgeEffect.isHidden = true
let favoriteButton = UIBarButtonItem(image: UIImage(systemName: "heart"), style: .plain, target: self, action: #selector(favoriteAction))
favoriteButton.hidesSharedBackground = true // Opt out of shared glass background
struct MyWidgetView: View {
@Environment(\.widgetRenderingMode) var renderingMode
var body: some View {
if renderingMode == .accented {
// Tinted mode: white-tinted, themed glass background
} else {
// Full color mode: standard appearance
}
}
}
HStack {
VStack(alignment: .leading) {
Text("Title")
.widgetAccentable() // Accent group
Text("Subtitle")
// Primary group (default)
}
Image(systemName: "star.fill")
.widgetAccentable() // Accent group
}
Image("myImage")
.widgetAccentedRenderingMode(.monochrome)
VStack { /* content */ }
.containerBackground(for: .widget) {
Color.blue.opacity(0.2)
}
| 决策 | 理由 |
|---|---|
| 使用 GlassEffectContainer 包装 | 性能优化,实现玻璃元素之间的变形 |
spacing 参数 | 控制合并距离——微调元素需要多近才能融合 |
@Namespace + glassEffectID | 在视图层次结构变化时实现平滑的变形过渡 |
interactive() 修饰符 | 明确选择加入触摸/指针反应——并非所有玻璃都应响应 |
| UIKit 中的 UIGlassContainerEffect | 与 SwiftUI 保持一致的容器模式 |
| 小组件中的强调色渲染模式 | 当用户选择带色调的主屏幕时,系统会应用带色调的玻璃效果 |
.glassEffect().interactive()withAnimation,以启用平滑的变形过渡.glassEffect() 视图而不使用 GlassEffectContainerclipsToBounds = true