agentsclimarketplace

Liquid glass troubleshooting

Skill SohrabZ/liquid-glass-skills/liquid-glass-troubleshooting

Fix, adapt, and ship iOS 26 Liquid Glass in the real world: readability over busy/media backgrounds (gradient fade, dimming, tinting, variant choice), correct layering (avoid glass-on-glass), platform differences (iOS/iPadOS/macOS/watchOS/tvOS/visionOS) and minimum OS/device requirements, iOS 18 backward compatibility (availability fallback + opt-out via UIDesignRequiresCompatibility), UIKit integration (UIGlassEffect, UIGlassContainerEffect), known beta bugs with workarounds, and performance/battery implications. Use this skill when the user reports glass that's "hard to read", "looks wrong over an image", "has rendering artifacts", widgets showing a black background, disorienting toolbar animation on navigation, asks "how do I support iOS 18 too", "how do I use glass in UIKit", or "why is my battery draining". Trigger on "glass unreadable", "busy background", "glass-on-glass", "UIDesignRequiresCompatibility", "UIGlassEffect", "glassProminent artifacts", "widget black background".From its SKILL.md

Install
npx -y skills add SohrabZ/liquid-glass-skills --skill liquid-glass-troubleshooting

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.5 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

Liquid Glass Troubleshooting & Real-World Adaptation

Field fixes for readability, layering, platform/version support, UIKit, known bugs, and performance. (Basics: liquid-glass-foundations.)

Readability over complex backgrounds

Glass over busy/colorful/animated content becomes hard to read. Four remedies, roughly in order of preference:

1. Gradient fade — fade a background color in behind the control. A reusable modifier (deliquify()) is in references/BackgroundFade.swift:

ScrollView { ColorfulContent() }.deliquify()

2. Strategic tinting — add semantic color for contrast:

.glassEffect(.regular.tint(.purple.opacity(0.8)))

3. Choose the right variant.regular for most contexts; .clear only over media-rich content with bold foreground.

4. Background dimming — required when using .clear over imagery:

ZStack {
    BackgroundImage().overlay(Color.black.opacity(0.3))   // subtle dimming
    GlassControls().glassEffect(.clear)
}

Layering: avoid glass-on-glass

// ❌ Confusing hierarchy — stacked glass
VStack {
    HeaderView().glassEffect()
    ContentView().glassEffect()
    FooterView().glassEffect()
}

// ✅ One floating glass layer over plain content
ZStack {
    ContentView()                 // no glass
    HeaderView().glassEffect()    // single floating layer
}

Layering philosophy: content (bottom, no glass) → navigation (middle, Liquid Glass) → overlay (top, vibrancy/fills on glass).

Platform differences

PlatformAdaptations
iOSFloating tab bars, bottom search placement
iPadOSFloating sidebars, ambient reflection, larger shadows
macOSConcentric window corners, adaptive search bars, taller controls
watchOSLocation-aware widgets, fluid navigation
tvOSFocused glass effects, directional highlights

Minimums: iOS/iPadOS/macOS Tahoe/watchOS/tvOS/visionOS 26.0+, Xcode 26.0+. Devices: iPhone 11 / iPhone SE (2nd gen) or later get the full effect; older devices fall back to frosted glass with reduced effects.

Backward compatibility (supporting iOS 18)

Recompiling with Xcode 26 adopts glass automatically. To hold off (expires with iOS 27):

<!-- Info.plist -->
<key>UIDesignRequiresCompatibility</key>
<true/>

For code that runs on both iOS 26 and iOS 18, gate on availability with a manual fallback. A drop-in glassedEffect(...) extension is in references/GlassCompat.swift:

Text("Compatible")
    .padding()
    .glassedEffect(in: Capsule(), interactive: true)

UIKit integration

import UIKit

let glassEffect = UIGlassEffect(glass: .regular, isInteractive: true)
let effectView = UIVisualEffectView(effect: glassEffect)
effectView.frame = CGRect(x: 0, y: 0, width: 200, height: 50)
view.addSubview(effectView)

let containerEffect = UIGlassContainerEffect()
let containerView = UIVisualEffectView(effect: containerEffect)

Best practices: remove custom backgrounds so glass shows; update presentation controllers for sheets; handle UIBarButtonItem sizing; use hidesSharedBackground = true to drop glass from specific items.

Known issues & workarounds (beta)

  • Interactive shape mismatch.glassEffect(.regular.interactive(), in: RoundedRectangle()) responds with a Capsule shape. Workaround: use .buttonStyle(.glass) for buttons.
  • .glassProminent + .circle artifacts — add .clipShape(Circle()).
  • Widget black background (Standard/Dark modes) — no complete fix; Tinted and Transparent modes work with Color.clear.
  • Disorienting toolbar animation on navigation — give the item a stable id:
    ToolbarItem(id: "constantID") { Button("Done") { } }
    

Performance implications

  • Battery: early testing showed ~13% drain (iOS 26) vs ~1% (iOS 18) on iPhone 16 Pro Max, plus more heat and higher CPU/GPU load on older devices.
  • Optimize: use GlassEffectContainer for multiple elements; limit continuous animations; let glass rest; test on ~3-year-old devices; profile with Instruments.
  • Memory: real-time blur consumes GPU memory and samples a larger area than the element; shared sampling regions reduce that overhead.

Related skills

  • Performance-first patterns → liquid-glass-advanced
  • Design rules that prevent most of these problems → liquid-glass-best-practices

What ships with it: 2 files

2.8 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.