liquid-glass
Skill1 starsChanged 52 days agoMITView on GitHub
Universal physically-accurate optical glass refraction for web interfaces (Chromium, Safari, Firefox, iOS). Replaces flat CSS backdrop-filter blur with real Snell's Law refraction, curl-free squircle bevel displacement, chromatic aberration, and specular rim lighting. Use when asked to implement liquid glass, realistic refraction, Apple-style macOS/iOS glass lenses, feDisplacementMap optical effects, Outpace Studios glass, or high-end refractive navigation bars, magnifiers, and interactive cards.
19 other projects use a version of this.
Adopted by
Most recently taken up by
- Masih-0x3/agent-skillstheir own version, first seen Nov 29, 2026
- frankxai/blue-life-commonstheir own version, first seen Nov 29, 2026
- rshankras/claude-code-apple-skillstheir own version, first seen Nov 29, 2026
- magicpatterns/skillstheir own version, first seen Nov 29, 2026
- lingyired/status-triotheir own version, first seen Nov 16, 2026
- axot/agent-skillstheir own version, first seen Nov 16, 2026
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- openai/plugins★ 8.4ksame name
- lingyired/status-trio★ 2.2ksame name
- rshankras/claude-code-apple-skills★ 915same name
- skopevoj/spoti.pw★ 732same name
- eylonshm/claude-meter★ 15same name
- patrickserrano/skills★ 13same name
- heyparsadev/liquid-glass-skill★ 11same name
- charlie947/reel-editing-skills★ 9same name
- jcm-developer/liquid-glass-components★ 4same name
- YordiLorenzo/liquid-glass-skills★ 3same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository95 other files it gives its agents.
- yao-meta-skill/AGENTS.mdAGENTS.md
- img2threejs/CLAUDE.mdCLAUDE.md
- animate-expoSkill
- animateSkill
- animation-vocabularySkill
- apple-designSkill
- ask-sonnerSkill
- brandkitSkill
- cavemanSkill
- clone-websiteSkill
- computer-useSkill
- design-an-interfaceSkill
- design-taste-frontendSkill
- design-taste-frontend-v1Skill
- diagnoseSkill
- dogfoodSkill
- edit-articleSkill
- emil-design-engSkill
- figma-code-connect-componentsSkill
- figma-create-design-system-rulesSkill
- figma-create-new-fileSkill
- figma-generate-designSkill
- figma-generate-librarySkill
- figma-implement-designSkill
- figmaSkill
- figma-useSkill
- find-animation-opportunitiesSkill
- full-output-enforcementSkill
- gc-minimal-zine-poster-v0-1Skill
- geistSkill
- git-guardrails-claude-codeSkill
- gpt-image-2Skill
- gpt-tasteSkill
- grill-meSkill
- grill-with-docsSkill
- guizang-ppt-skillSkill
- hallmarkSkill
- handoffSkill
- hermes-desktop-pluginsSkill
- high-end-visual-designSkill
- humanizer-zhSkill
- hyperframes-animationSkill
- hyperframes-cliSkill
- hyperframes-coreSkill
- hyperframes-creativeSkill
- hyperframes-keyframesSkill
- hyperframes-registrySkill
- hyperframesSkill
- imagegen-frontend-mobileSkill
- imagegen-frontend-webSkill
- image-to-codeSkill
- img2threejsSkill
- improve-animationsSkill
- improve-codebase-architectureSkill
- industrial-brutalist-uiSkill
- kb-retrieverSkill
- linearSkill
- liquid-metalSkill
- logo-designSkill
- mav-slidecraft-skillSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Use the bundled mathematical generator in scripts/generate_glass_map.js:
- Distinctive: line 102
Before shipping, verify these 5 critical rules to prevent Safari / iOS failures:
- Very specific: line 145
SVG Filter Injection: Add <feGaussianBlur in="refracted" stdDeviation="2.5" result="frosted" /> before blending the specular rim highlight.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Liquid Glass for the Web
Liquid Glass creates true physical optical refraction on the web. It discards fake Gaussian backdrop blur (backdrop-filter: blur()) in favor of genuine Snell's Law light refraction through a curl-free squircle dome, supporting chromatic aberration and specular rim lighting across all modern browsers at 60–120 FPS.
1. The Core Architectural Contract
"Refract a Cloned Backdrop, Never the Live DOM."
Standard CSS backdrop-filter: url(#svg-filter) is broken on Safari and Firefox. To achieve 100% universal cross-browser compatibility:
- Keep the Base DOM Interactive: Render the real page elements normally in a container (
GlassScene). - Duplicate Backdrop inside the Lens: Render a lightweight duplicate of the visual backdrop inside the lens viewport.
- Negative Counter-Translation (1:1):
/* As the lens moves to (lensX, lensY), the cloned backdrop shifts to (-lensX, -lensY) */ transform: translate3d(-lensXpx, -lensYpx, 0); - Apply Standard Element Filter: Apply standard CSS
filter: url(#glass-filter)to the cloned container, notbackdrop-filter. Normalfilter: url()has been universally accelerated across all browsers for over a decade. - Clip & Layer: Set the lens to
overflow: hidden; border-radius: inherit; pointer-events: none. Interactive controls inside the lens sit in a higher z-index layer withpointer-events: auto.
2. Fast Implementation Protocol
Step 1: Generate the Displacement & Normal Map
Use the bundled mathematical generator in scripts/generate_glass_map.js:
import { generateGlassMap } from './scripts/generate_glass_map.js';
const map = generateGlassMap({
width: 320, // Lens pixel width
height: 80, // Lens pixel height
radius: 24, // Corner squircle radius
bevelWidth: 18, // Width of refracting rim (core remains crystal flat)
refractiveIndex: 1.5, // Optical crown glass n=1.5
dispScale: 1.0 // Deflection intensity
});
// MANDATORY FOR SAFARI: Convert canvas to binary Blob URL
const blob = await map.toBlob();
const blobUrl = URL.createObjectURL(blob);Step 2: Inject the Adaptive SVG Filter
Switch between Multi-Pass (Chromium GPU) and Lean Single-Pass (WebKit/Mobile):
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
<defs>
<filter id="liquid-glass-filter" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
<feImage href="${blobUrl}" result="dispMap" />
<!-- Unified Displacement Pass -->
<feDisplacementMap in="SourceGraphic" in2="dispMap" scale="22"
xChannelSelector="R" yChannelSelector="G" result="refracted" />
<!-- Specular Rim Highlight (extracted from Blue channel) -->
<feColorMatrix in="dispMap" type="matrix"
values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0" result="rimHighlight" />
<feBlend in="rimHighlight" in2="refracted" mode="screen" />
</filter>
</defs>
</svg>Step 3: Wire the Scene & Lens Layout
<div class="glass-scene" style="position: relative; overflow: hidden;">
<!-- Primary Live Content -->
<div class="glass-backdrop" id="backdrop">...</div>
<!-- The Floating Lens -->
<div class="glass-lens" style="position: absolute; overflow: hidden; width: 320px; height: 80px; border-radius: 24px; box-shadow: 0 12px 40px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.25);">
<!-- Filtered Refraction Container -->
<div style="position: absolute; inset: 0; filter: url(#liquid-glass-filter); pointer-events: none;">
<!-- Counter-translated Clone -->
<div id="backdrop-clone" style="position: absolute; transform: translate3d(-x, -y, 0);">
<!-- Backdrop DOM clone -->
</div>
</div>
<!-- Interactive Foreground (Buttons, Links) -->
<div style="position: relative; z-index: 10; pointer-events: auto;">
<nav>...</nav>
</div>
</div>
</div>3. Strict Pre-Flight Checklist (The 5 WebKit Traps)
Before shipping, verify these 5 critical rules to prevent Safari / iOS failures:
- 1.
blob:URL Only: Never pass base64data:image/png;base64,...into<feImage>. Safari silently ignores it. Always useURL.createObjectURL(blob). - 2. Force
sRGB: Always addcolor-interpolation-filters="sRGB"on<filter>. Without this, SVG defaults tolinearRGB, causing muddy colors and dark refraction fringes. - 3. Unique Filter IDs: Safari caches SVG filter output textures by ID. When resizing or recreating a lens, append a unique ID or timestamp (
#glass-filter-${uid}). - 4. Adaptive Lean Mode: On Safari/iOS (
useLeanGlass()), use single-pass displacement instead of 3-pass RGB channel separation to prevent CPU software-rasterizer stutter. - 5. Viewport Pre-Clipping: Keep the cloned backdrop clipped to the lens bounding box to avoid iOS WebKit memory tile exhaustion.
4. Accessibility & Fallbacks
prefers-reduced-motion: Disable spring lag or inertia animations; snap lens coordinates instantly on hover/focus.prefers-reduced-transparency: Bypass SVG refraction entirely; render a clean, high-contrast semi-opaque container:@media (prefers-reduced-transparency: reduce) { .glass-lens { background: rgba(18, 24, 38, 0.95) !important; backdrop-filter: none !important; filter: none !important; } }
5. Optical Material & Style Modification Recipes (玻璃质感魔改指南)
Liquid Glass is not limited to standard clear glass. You can modify its physical media, surface finish, color tint, and chromatic dispersion:
💧 1. 清透水滴微透镜 (Pure Water Droplet)
- Visuals: Light, organic, minimal dispersion, soft fluid magnification.
- Parameters:
refractiveIndex: 1.33(water),dispScale: 10,bevelWidth: 10px, identical RGB scale (disable chromatic fringe).
💎 2. 蓝宝石 / 钻石重晶透镜 (Heavy Sapphire / Diamond)
- Visuals: Dramatic optical bending, deep magnification, intense rainbow fringes.
- Parameters:
refractiveIndex: 1.85 ~ 2.42,dispScale: 36,bevelWidth: 32px. - Dispersion Scaling: Scale red to
scale * 1.18, green toscale * 1.0, blue toscale * 0.82.
🌫️ 3. 哑光酸蚀毛玻璃 (Acid-Etched Frosted Glass)
- Visuals: Physical refraction paired with luxurious matte diffusion (Apple-style frosted glass).
- SVG Filter Injection: Add
<feGaussianBlur in="refracted" stdDeviation="2.5" result="frosted" />before blending the specular rim highlight.
🍷 4. 烟熏暗晶 / 琥珀有色琉璃 (Smoked & Tinted Glass)
- Visuals: High-end sunglasses / smoked acrylic with tinted color absorption.
- Implementation: Inject an
<feColorMatrix>color grade filter, or apply CSS tint overlay:/* Amber Smoked Glass tint */ background: rgba(245, 158, 11, 0.08); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.3);
6. Detailed References & Ready-to-Use Code
- REFERENCE.md: Full Snell's law derivation, curl-free gradient proof ($\nabla \times \vec{D} = 0$), chromatic aberration math, full React components (
GlassScene.tsx,GlassLens.tsx,useLeanGlass.ts), and standalone Vanilla JS/CSS demo. - scripts/generate_glass_map.js: Standalone, zero-dependency script generating squircle normal displacement textures with specular rim highlights.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

