axiom-liquid-glass by charleswiltgen/axiom
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-liquid-glass在以下情况下使用:
axiom-liquid-glass-ref 获取全面的应用范围采用指南(应用图标、控件、导航、菜单、窗口、平台注意事项)Liquid Glass 是 Apple 在 WWDC 2025 推出的下一代材料设计系统。它代表了从先前材料(Aqua、iOS 7 模糊、灵动岛)的重大演进,通过创建一种新的数字超材料来实现:
核心理念:Liquid Glass 通过圆润、漂浮的形态,补充了圆润、沉浸式屏幕的演进,使触摸交互感觉自然,同时让内容透显出来。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Liquid Glass 通过透镜效果定义自身——扭曲和弯曲光线以传达存在感、运动和形态。元素通过调制光线弯曲(而非淡入淡出)来显现/消失。控件感觉超轻量级,但在视觉上可区分。
Liquid Glass 持续自适应,没有固定的明暗外观:
glassEffect 修饰符// 基本用法 - 在胶囊形状内应用玻璃效果
Text("Hello")
.glassEffect()
// 自定义形状
Text("Hello")
.glassEffect(in: RoundedRectangle(cornerRadius: 12))
// 交互元素(iOS - 用于控件/容器)
Button("Tap Me") {
// action
}
.glassEffect()
.interactive() // 在 iOS 上为自定义控件添加
自动采用:只需使用 Xcode 26 重新编译,即可自动为标准控件带来 Liquid Glass 效果。
关键决策:切勿在同一界面中混合使用常规变体和透明变体。
最通用。完全的自适应效果,自动可读性,在任何尺寸下覆盖任何内容都有效。用于导航栏、标签栏、工具栏、按钮、菜单、侧边栏。
永久更透明,无自适应行为。需要调暗层以确保可读性。
仅在满足以下所有三个条件时使用:
在不满足所有三个条件的情况下使用透明变体会导致可读性差。有关实现示例,请参阅 axiom-liquid-glass-ref。
Liquid Glass 由四个协同工作的层组成:
滚动边缘效果在内容滚动时将其融入背景,将玻璃提升到移动内容之上。当存在固定的辅助视图(例如,列标题)时,使用 .scrollEdgeEffect(.hard) 以获得额外的视觉分离。完整的 API 详情请参阅 axiom-liquid-glass-ref。
Liquid Glass 引入了自适应着色——选择一种颜色会生成映射到下方内容亮度的色调,灵感来源于现实中的彩色玻璃。与所有玻璃行为兼容(变形、适应、交互)。
// ✅ 仅为主操作着色
Button("View Bag") { }.tint(.red).glassEffect()
// ❌ 不要为所有东西着色——当所有东西都着色时,没有东西突出
VStack {
Button("Action 1").tint(.blue).glassEffect()
Button("Action 2").tint(.green).glassEffect() // 无层次结构
}
// ❌ 实心填充破坏了 Liquid Glass 的特性
Button("Action") { }.background(.red) // 不透明,错误
// ✅ 使用 .tint() 而非实心填充
Button("Action") { }.tint(.red).glassEffect() // 植根于环境
为主 UI 操作保留着色。使用内容层中的颜色作为整体应用配色方案。
SwiftUI 在玻璃效果内自动使用鲜艳的文本和色调颜色——无需手动调整。小元素(导航栏、标签栏)切换明暗以提高可辨识性。大元素(菜单、侧边栏)适应但不切换(对于大面积来说太分散注意力)。符号/字形镜像玻璃行为并自动最大化对比度。
有选择地使用自定义色调颜色以实现特定的功能目的(例如,在单个工具栏按钮上使用 .tint(.orange) 以强调)。
Liquid Glass 提供了多种辅助功能,可在不牺牲其魔力的情况下修改材料:
开发者所需操作:无 - 使用 Liquid Glass 时,所有功能自动可用。
关注点:复杂视图层次结构中 Liquid Glass 的渲染成本
指导原则:
优化:
// ❌ 避免深度嵌套
ZStack {
GlassContainer1()
.glassEffect()
ZStack {
GlassContainer2()
.glassEffect()
// 更多嵌套...
}
}
// ✅ 扁平化层次结构
VStack {
GlassContainer1()
.glassEffect()
GlassContainer2()
.glassEffect()
}
自适应行为具有计算成本:
系统处理优化,但请注意:
在这些配置下进行测试:
有关全面的 UI 测试模式,包括视觉回归和辅助功能测试,请参阅 axiom-ui-testing。
在设计审查压力下,你会面临以下要求:
这些听起来很合理。但它们违反了框架。 你的工作:用证据而非意见来辩护。
如果你听到任何这些,停止并参考技能:
"我想做这个改动,但让我给你看看 Apple 关于透明变体的指导。
它需要满足三个条件:
1. 媒体丰富的内容背景
2. 用于可读性的调暗层
3. 顶部是粗体、明亮的控件
让我展示哪些屏幕满足所有三个条件..."
在设备上打开应用。展示:
"透明变体在这 6 个英雄部分可以完美工作,那里满足所有三个条件。
常规变体处理其他所有情况,并具有自动可读性。两全其美。"
如果被否决(设计师坚持到处使用透明变体):
Slack 消息给 PM + 设计师:
"设计审查决定在所有控件上使用透明变体。
重要提示:透明变体需要在低对比度场景下进行可读性测试
(明亮的阳光、深色内容)。如果发布后我们看到辅助功能问题,
我们将需要紧急跟进。我主动标记此问题。"
// 在会议中,并排演示:
// 常规变体(当前实现)
NavigationBar()
.glassEffect() // 自动可读性
// 透明变体(被要求)
NavigationBar()
.glassEffect(.clear) // 下方需要调暗层
// 展示三个条件的检查清单
// 演示哪些屏幕通过/失败
// 提供方案:英雄部分用透明,其他地方用常规
有时设计师有正当理由覆盖技能。如果满足以下条件,请接受:
"设计审查决定在[这些位置]使用透明变体。
我们理解这需要:
- 满足所有三个条件:[列出它们]
- 低对比度场景下潜在的可读性问题
- 跨亮度级别的辅助功能测试
监控计划:
- 前 48 小时收集用户反馈
- 运行辅助功能审计
- 如果需要,准备好回退到常规变体的方案"
这保护了你们双方,并表明你不是在阻碍——只是在降低风险。
审查 Liquid Glass 实现(你自己的或他人的代码)时,检查:
// ❌ 玻璃在内容层上——与导航层竞争
List(landmarks) { landmark in
LandmarkRow(landmark).glassEffect()
}
// ✅ 玻璃仅在导航层上
.toolbar {
ToolbarItem { Button("Add") { }.glassEffect() }
}
// ❌ 透明变体无调暗层——可读性差
ZStack {
VideoPlayer(player: player)
PlayButton().glassEffect(.clear)
}
// ✅ 透明变体带调暗层
ZStack {
VideoPlayer(player: player)
.overlay(.black.opacity(0.4))
PlayButton().glassEffect(.clear)
}
仅为主操作着色。当所有内容都着色时,没有东西突出。
不要硬编码阴影或固定不透明度。拥抱自适应行为——在明暗模式和不同背景下进行测试。
问题:玻璃显得太透明或不可见
检查:
问题:玻璃显得不透明或有硬边
检查:
问题:在深色背景上玻璃未切换到深色样式
检查:
.preferredColorScheme())问题:深色模式下玻璃上的内容不可读
修复:
// 让 SwiftUI 自动处理对比度
Text("Label")
.foregroundStyle(.primary) // ✅ 自动适应
// 不要硬编码颜色
Text("Label")
.foregroundColor(.black) // ❌ 不会适应深色模式
问题:使用 Liquid Glass 时滚动感觉卡顿
调试:
axiom-swiftui-performance 技能)问题:动画卡顿
检查:
之前(UIKit):
let blurEffect = UIBlurEffect(style: .systemMaterial)
let blurView = UIVisualEffectView(effect: blurEffect)
view.addSubview(blurView)
之后(SwiftUI 带 Liquid Glass):
ZStack {
// Content
}
.glassEffect()
优势:自动适应(无需手动切换样式),内置交互反馈,平台适当的外观,包含辅助功能。
何时保留自定义材料:无法通过 Liquid Glass 实现的特定艺术效果,需要与 iOS < 26 向后兼容,或与 Liquid Glass 原则不兼容的非标准 UI 范式。
逐步迁移时,玻璃效果按框架应用:
.glassEffect() / .glassBackgroundEffect()axiom-liquid-glass-ref)UIHostingController 中的 SwiftUI 视图独立获得玻璃效果完整的 UIBlurEffect 迁移映射表请参阅 axiom-liquid-glass-ref。
要在使用最新 SDK 的同时保持先前外观:
<key>UIDesignRequiresCompatibility</key>
<true/>
效果:使用 iOS 26 SDK 构建的应用,外观匹配 iOS 18 及更早版本,Liquid Glass 效果被禁用,使用先前的模糊/材料样式。
何时使用:需要时间审计界面更改,采用渐进采用策略,或暂时保持精确外观。
迁移策略:
UIDesignRequiresCompatibility 发布完整的 API 参考,包括 glassEffect()、glassBackgroundEffect()、工具栏修饰符、滚动边缘效果、导航/搜索 API、控件/布局、GlassEffectContainer、glassEffectID、类型和向后兼容性,请参阅 axiom-liquid-glass-ref。
WWDC:2025-219、2025-256、2025-323(使用新设计构建 SwiftUI 应用)
文档:/technologyoverviews/adopting-liquid-glass、/swiftui/landmarks-building-an-app-with-liquid-glass、/swiftui/applying-liquid-glass-to-custom-views
技能:axiom-liquid-glass-ref
平台: iOS 26+、iPadOS 26+、macOS Tahoe、axiom-visionOS 3 Xcode: 26+ 历史: 查看 git 日志了解更改
每周安装次数
141
代码仓库
GitHub 星标数
601
首次出现
2026年1月21日
安全审计
安装于
opencode116
codex110
claude-code109
gemini-cli105
cursor98
github-copilot98
Use when:
axiom-liquid-glass-ref for comprehensive app-wide adoption guidance (app icons, controls, navigation, menus, windows, platform considerations)Liquid Glass is Apple's next-generation material design system introduced at WWDC 2025. It represents a significant evolution from previous materials (Aqua, iOS 7 blurs, Dynamic Island) by creating a new digital meta-material that:
Core Philosophy : Liquid Glass complements the evolution of rounded, immersive screens with rounded, floating forms that feel natural to touch interaction while letting content shine through.
Liquid Glass defines itself through lensing — warping and bending light to communicate presence, motion, and form. Elements materialize in/out by modulating light bending (not fading). Controls feel ultra-lightweight yet visually distinguishable.
Liquid Glass continuously adapts without fixed light/dark appearance:
glassEffect Modifier// Basic usage - applies glass within capsule shape
Text("Hello")
.glassEffect()
// Custom shape
Text("Hello")
.glassEffect(in: RoundedRectangle(cornerRadius: 12))
// Interactive elements (iOS - for controls/containers)
Button("Tap Me") {
// action
}
.glassEffect()
.interactive() // Add for custom controls on iOS
Automatic Adoption : Simply recompiling with Xcode 26 brings Liquid Glass to standard controls automatically.
CRITICAL DECISION : Never mix Regular and Clear in the same interface.
Most versatile. Full adaptive effects, automatic legibility, works in any size over any content. Use for navigation bars, tab bars, toolbars, buttons, menus, sidebars.
Permanently more transparent, no adaptive behaviors. Requires dimming layer for legibility.
Use ONLY when ALL three conditions are met :
Using Clear without meeting all three conditions results in poor legibility. See axiom-liquid-glass-ref for implementation examples.
Liquid Glass is composed of four layers working together:
Scroll edge effects dissolve content into background as it scrolls, lifting glass above moving content. Use .scrollEdgeEffect(.hard) when pinned accessory views exist (e.g., column headers) for extra visual separation. See axiom-liquid-glass-ref for full API details.
Liquid Glass introduces adaptive tinting — selecting a color generates tones mapped to content brightness underneath, inspired by colored glass in reality. Compatible with all glass behaviors (morphing, adaptation, interaction).
// ✅ Tint primary actions only
Button("View Bag") { }.tint(.red).glassEffect()
// ❌ Don't tint everything — when everything is tinted, nothing stands out
VStack {
Button("Action 1").tint(.blue).glassEffect()
Button("Action 2").tint(.green).glassEffect() // No hierarchy
}
// ❌ Solid fills break Liquid Glass character
Button("Action") { }.background(.red) // Opaque, wrong
// ✅ Use .tint() instead of solid fills
Button("Action") { }.tint(.red).glassEffect() // Grounded in environment
Reserve tinting for primary UI actions. Use color in the content layer for overall app color scheme.
SwiftUI automatically uses vibrant text and tint colors within glass effects — no manual adjustment needed. Small elements (navbars, tabbars) flip light/dark for discernibility. Large elements (menus, sidebars) adapt but don't flip (too distracting for large surface area). Symbols/glyphs mirror glass behavior and maximize contrast automatically.
Use custom tint colors selectively for distinct functional purpose (e.g., .tint(.orange) on a single toolbar button for emphasis).
Liquid Glass offers several accessibility features that modify material without sacrificing its magic :
Developer Action Required : None - all features available automatically when using Liquid Glass.
Concern : Liquid Glass rendering cost in complex view hierarchies
Guidance :
Optimization :
// ❌ Avoid deep nesting
ZStack {
GlassContainer1()
.glassEffect()
ZStack {
GlassContainer2()
.glassEffect()
// More nesting...
}
}
// ✅ Flatten hierarchy
VStack {
GlassContainer1()
.glassEffect()
GlassContainer2()
.glassEffect()
}
Adaptive behaviors have computational cost :
System handles optimization , but be mindful:
Test across these configurations:
See axiom-ui-testing for comprehensive UI testing patterns including visual regression and accessibility testing.
Under design review pressure, you'll face requests to:
These sound reasonable. But they violate the framework. Your job: defend using evidence, not opinion.
If you hear ANY of these, STOP and reference the skill :
"I want to make this change, but let me show you Apple's guidance on Clear variant.
It requires THREE conditions:
1. Media-rich content background
2. Dimming layer for legibility
3. Bold, bright controls on top
Let me show which screens meet all three..."
Open the app on a device. Show:
"Clear can work beautifully in these 6 hero sections where all three conditions apply.
Regular handles everything else with automatic legibility. Best of both worlds."
If overruled (designer insists on Clear everywhere):
Slack message to PM + designer:
"Design review decided to use Clear variant across all controls.
Important: Clear variant requires legibility testing in low-contrast scenarios
(bright sunlight, dark content). If we see accessibility issues after launch,
we'll need an expedited follow-up. I'm flagging this proactively."
// In the meeting, demo side-by-side:
// Regular variant (current implementation)
NavigationBar()
.glassEffect() // Automatic legibility
// Clear variant (requested)
NavigationBar()
.glassEffect(.clear) // Requires dimming layer below
// Show the three-condition checklist
// Demonstrate which screens pass/fail
// Offer: Clear in hero sections, Regular elsewhere
Sometimes designers have valid reasons to override the skill. Accept if:
"Design review decided to use Clear variant [in these locations].
We understand this requires:
- All three conditions met: [list them]
- Potential legibility issues in low-contrast scenarios
- Accessibility testing across brightness levels
Monitoring plan:
- Gather user feedback first 48 hours
- Run accessibility audit
- Have fallback to Regular variant ready for push if needed"
This protects both of you and shows you're not blocking - just de-risking.
When reviewing Liquid Glass implementation (your code or others'), check:
// ❌ Glass on content layer — competes with navigation
List(landmarks) { landmark in
LandmarkRow(landmark).glassEffect()
}
// ✅ Glass on navigation layer only
.toolbar {
ToolbarItem { Button("Add") { }.glassEffect() }
}
// ❌ Clear without dimming — poor legibility
ZStack {
VideoPlayer(player: player)
PlayButton().glassEffect(.clear)
}
// ✅ Clear with dimming layer
ZStack {
VideoPlayer(player: player)
.overlay(.black.opacity(0.4))
PlayButton().glassEffect(.clear)
}
Tint primary action only. When everything is tinted, nothing stands out.
Don't hardcode shadows or fixed opacity. Embrace adaptive behavior — test across light/dark modes and backgrounds.
Issue : Glass appears too transparent or invisible
Check :
Issue : Glass appears opaque or has harsh edges
Check :
Issue : Glass doesn't flip to dark style on dark backgrounds
Check :
.preferredColorScheme() if unintended)Issue : Content on glass not legible in dark mode
Fix :
// Let SwiftUI handle contrast automatically
Text("Label")
.foregroundStyle(.primary) // ✅ Adapts automatically
// Don't hardcode colors
Text("Label")
.foregroundColor(.black) // ❌ Won't adapt to dark mode
Issue : Scrolling feels janky with Liquid Glass
Debug :
axiom-swiftui-performance skill)Issue : Animations stuttering
Check :
Before (UIKit):
let blurEffect = UIBlurEffect(style: .systemMaterial)
let blurView = UIVisualEffectView(effect: blurEffect)
view.addSubview(blurView)
After (SwiftUI with Liquid Glass):
ZStack {
// Content
}
.glassEffect()
Benefits : Automatic adaptation (no manual style switching), built-in interaction feedback, platform-appropriate appearance, accessibility features included.
When to keep custom materials : Specific artistic effect not achievable with Liquid Glass, backward compatibility with iOS < 26 required, or non-standard UI paradigm incompatible with Liquid Glass principles.
When migrating incrementally, glass effects apply per-framework:
.glassEffect() / .glassBackgroundEffect()axiom-liquid-glass-ref for migration mapping)UIHostingController get glass effects independentlySee axiom-liquid-glass-ref for complete UIBlurEffect migration mapping table.
To ship with latest SDKs while maintaining previous appearance:
<key>UIDesignRequiresCompatibility</key>
<true/>
Effect : App built with iOS 26 SDK, appearance matches iOS 18 and earlier, Liquid Glass effects disabled, previous blur/material styles used.
When to use : Need time to audit interface changes, gradual adoption strategy, or maintain exact appearance temporarily.
Migration strategy :
UIDesignRequiresCompatibility enabledFor complete API reference including glassEffect(), glassBackgroundEffect(), toolbar modifiers, scroll edge effects, navigation/search APIs, controls/layout, GlassEffectContainer, glassEffectID, types, and backward compatibility, see axiom-liquid-glass-ref.
WWDC : 2025-219, 2025-256, 2025-323 (Build a SwiftUI app with the new design)
Docs : /technologyoverviews/adopting-liquid-glass, /swiftui/landmarks-building-an-app-with-liquid-glass, /swiftui/applying-liquid-glass-to-custom-views
Skills : axiom-liquid-glass-ref
Platforms: iOS 26+, iPadOS 26+, macOS Tahoe, axiom-visionOS 3 Xcode: 26+ History: See git log for changes
Weekly Installs
141
Repository
GitHub Stars
601
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode116
codex110
claude-code109
gemini-cli105
cursor98
github-copilot98
Flutter布局指南:构建响应式UI的约束规则与自适应设计模式
1,200 周安装
Microsoft Clarity自动化工具包:通过Rube MCP实现用户行为分析自动化
1 周安装
Maintainx自动化指南:通过Rube MCP和Composio工具包实现工作流自动化
1 周安装
Mailsoftly自动化集成指南:通过Rube MCP实现邮件营销自动化
1 周安装
Mailcoach自动化指南:通过Rube MCP和Composio实现邮件营销自动化
1 周安装
Loomio自动化工具:通过Rube MCP和Composio实现Loomio操作自动化
1 周安装
Lodgify自动化集成指南:通过Rube MCP和Composio工具包实现民宿管理自动化
1 周安装