411 points by kris-kay 2 days ago | 115 comments
Cross-browser compatibility is actually the reason I rely on ::before and ::after pseudo-elements to build up the effect. Move the color/opacity to the main element, and you’ll get weird color bleed on the corners in Chrome. Move the texture, and it muddles the bevel’s specular highlight. Move the bevel, and it gets blurred out by the backdrop-filter. And so on!
Layers include: * Adjustable blur, brightness, and saturation (backdrop-filter) * Subtle translucent texture * Faux 3D bevel (using box-shadows, not an outline)
Glassmorphism is rather heavy on resources, so it’s best used as an accent and avoided on wide desktop elements. Should be compatible with recent versions of Chrome, Safari, and Firefox (desktop and mobile). If you spot bugs or rendering glitches, I’d love to know!
Side note: this is an early preview of a framework-agnostic glass SCSS/component library I’m building.
chrismorgan 2 days ago
kris-kay 2 days ago
account42 7 hours ago
For me the tweaked version is much more distracting and looks more wrong due to conflicting depth signals.
andrewmcwatters 2 days ago
I instead assume that materials are by default more similar to paper.
chrismorgan 1 day ago
andrewmcwatters 1 day ago
Note the circle before it intersects with the rect, without accounting for pixels beyond the bounds, the blur is incorrect because the kernel doesn’t take into effect the circle.
Note the blur after extending the kernel beyond the visible bounds. While the blur is correct, the albedo of the shape passing through the rect no longer makes sense. The circle is not emissive, and yet despite this, you see the blur of the circle behind the rectangle without it intersecting in a full-bright environment. Why can we assume the environment is full-bright? Because there is no lighting. Only albedo.
Neither are correct.
chrismorgan 3 hours ago
nothrabannosir 1 day ago
chrismorgan 1 day ago
It’s not impossible that this will be adjusted in the future in some way, like how browsers quite some years ago shifted to premultiplying colours so that a gradient from white to transparent doesn’t go through semitransparent grey, but browsers are acting according to spec.
andrewmcwatters 1 day ago
jauntywundrkind 2 days ago
But missing out on the refractive aspect of glass takes away the strong visual separation of layers that IMO is Liquid Glass's biggest contribution.
Material has these wonderful designer resources showing how the app ought to be built of consistent moving layers, shown in 3D from the side. It's clear that there's these layers. But once you go 2d, put it all together, its incredibly hard for me to find all the features. The number of times that there's an action button in some corner that folks don't see massive. Motion sort of helps highlight the chrome vs content, but there's just so little thats visually defining.
Liquid Glass's biggest strength IMO is the edge distortion. That when the content moves, there's this non-linear motion that the human visual sense immediately picks up on. Static screenshots don't always look great, but in motion there's so much more distinction of elements than anything else I've seen.
And that key refractive element, that takes such huge advantage of human's motion sensing, is missing here.
I'd seen one other great web web demo, but am struggling to find it right now. I did find this one, which I don't think looks as good, and the performance is bad for me here on mobile. But it nicely breaks down steps and shows how complex a task this can be. Getting these edge distortions in is hard, and relying on SVG filters to do it is a brutal path to hack together. https://atlaspuplabs.com/blog/liquid-glass-but-in-css#breaki...
There is a collection of attempts (CodePen Spark) at Liquid Glass that I just found. Second link is one I thought did a pretty nice job, via very specifically pre defined / hard coded SVG. https://codepen.io/spark/453 https://codepen.io/lucasromerodb/pen/vEOWpYM
jasonthorsness 2 days ago
_benton 2 days ago
Stuff like React Native get it basically for free because their ui is still technically "native".
But apps that rely on web views are screwed and I'm sure Apple will be happy to push devs away from those solutions as they're inferior for users.
Now they just need to figure out a way to push RN apps towards true native.
kris-kay 2 days ago
cyral 2 days ago
_benton 1 day ago
dylan604 2 days ago
Does it matter at that point? Seriously asking.
starburst 2 days ago
Isn’t that impossible? If I call native code via binding or their official language, the same thing will happens.
_benton 1 day ago
gumby271 2 days ago
It's fun seeing the attempts to mimic Liquid Glass though, the most impressive so far is this Flutter package: https://pub.dev/packages/liquid_glass_renderer
dleeftink 2 days ago
kris-kay 2 days ago
dotancohen 2 days ago
dylan604 2 days ago
kris-kay 2 days ago
Of course, as soon as we figure out how to get it done, Apple will move on to the next thing. I'm okay with that though. It was a bold move, and I can't imagine how much time and money Apple spent making Liquid Glass look that good.
9dev 1 day ago
If this whole liquid glass effect catches on big time (which isn't out of the question right now), we might see something in the web platform that gives developers access to the platform primitives required to render it.
Why shouldn't there be an effort to make more OS UI elements available via HTML? There's no technical reason against it. So I'm not saying that is what's going to happen, but I don't think this is a kind of moat they created with the explicit intention to make web apps worse.
kris-kay 22 hours ago
Yes, exactly! Personally, I’m glad that Apple invests in this kind of R&D. They push the whole field forward as others try to catch up. I doubt they’ll ever make their UI freely available to all other platforms, but I do hope CSS continues to add features that make these effects much easier to implement on the web.
kevincox 1 day ago
> features an entirely new material called Liquid Glass. It combines the optical qualities of glass with a fluidity only Apple can achieve
https://www.apple.com/ca/newsroom/2025/06/apple-introduces-a...
But yeah, it is a pretty clever way to make most cross-platform toolkits stand out and create a desire to create true native apps which increases their moat and means that some apps will have only an Apple version (or a worse app on other platforms) rather than releasing the same app on all platforms.
silvestrov 2 days ago
Somewhat like the blind tasting tests of Coca Cola versus Pepsi versus supermarket brands.
dylan604 2 days ago
altairprime 2 days ago
kris-kay 21 hours ago
kris-kay 2 days ago
Thanks for sharing the resources!
incrudible 1 day ago
Good. I was already on the fence about frosted glass, but I absolutely hate the refraction effect, it is super distracting and will always look ugly in certain scenarios. Yes, it is how real glass behaves, but I do not care for that. It is like someone took the worst part of skeumorphism and doubled down on it, and I say that as someone who liked iOS better before version 7.
explosion-s 1 day ago
savy91 4 hours ago
cududa 24 hours ago
magic_hamster 2 days ago
I think the most immediate difference is how light has no interaction with the bevels. I also expect some light to shine back into the glass and affect the lighting and coloring. It's not enough to just throw a blur in there.
Also, glass can have its own shadow with some interesting caustics (not sure even Apple does this). I see the shadow here, and it feels like a simple drop shadow. It makes the box feel like a flat card more than a 3d physical object which I think is part of the new trend.
Either way, This will not be easy to emulate with just css, it's probably more suitable to be a shader running in a gpu.
ivape 2 days ago
HTML is dead. I see no reason to care about it because we only need <p> tags to get some text across, as just about everything else is used to make a webpage an ad-bomb. So let's just start again with the <p> tag and better gpu integration, and leave everything else out.
madeofpalk 2 days ago
They've been trying, with various degrees of success, over the past 10 years with Houdini.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_propert...
swyx 2 days ago
others
- https://ui.glass/generator/ Get started with this free CSS generator based on the glassmorphism design specifications to quickly design and customize the style properties.
- frosted glass sticky header https://www.joshwcomeau.com/css/backdrop-filter/
- glassy glassmorphism [codepen](https://codepen.io/a-trost/pen/dypQzwq), [in context](https://codepen.io/TurkAysenur/pen/ZEpxeYm)
```css
.blur-and-rotate {
border-radius: 20px;
backdrop-filter: blur(20px) hue-rotate(120deg);
-webkit-backdrop-filter: hue-rotate(120deg);
}
```
kris-kay 2 days ago
kris-kay 2 days ago
leptons 2 days ago
https://patorjk.com/software/taag/#p=testall&f=Graffiti&t=He...
swyx 2 days ago
vrighter 6 hours ago
Here goes everyone else rushing to do things just because apple did them.
Not everything apple does is good. This is one of those cases.
kris-kay 3 hours ago
mbforbes 2 days ago
Do you have a sense of which aspects are the most resource-intensive? Naively I would guess it's the backdrop-filter.
kris-kay 2 days ago
whycome 2 days ago
kris-kay 2 days ago
tyleo 2 days ago
Especially with respect to the abuse of box shadow.
kris-kay 2 days ago
smeej 1 day ago
kris-kay 22 hours ago
Are you referring to the code preview area?
In my first implementation, I had a small demo rectangle above the generator UI, but even a small one took up too much space and made the UI harder to use. If I let the whole page scroll, people got frustrated because it wasn’t obvious they needed to stay at the top of the scroll to see the rectangle they were editing.
Since this tool is mainly intended for coding, I’m prioritizing the desktop experience, with mobile acting more as a quick preview and proof that it works on mobile. That said, if you know of any similar UI that works really well on mobile, please share links!
armchairhacker 2 days ago
kris-kay 2 days ago
mikedelfino 2 days ago
kris-kay 2 days ago
mikedelfino 2 days ago
onli 1 day ago
pfg_ 2 days ago
kris-kay 2 days ago
xgpyc2qp 2 days ago
jdiff 2 days ago
v5v3 10 hours ago
tempodox 2 days ago
kris-kay 2 days ago
tempodox 2 days ago
kris-kay 2 days ago
and the CSS: .bg-video { position: fixed; z-index: -1; inset: 0; width: 100%; (don't set this to 100vw or you will have scrollbar issues) height: 100%; min-height: 100vh; object-fit: cover; object-position: center; pointer-events: none; }
The part I still need to do myself is provide multiple video sizes and show the one that's most suitable for the viewport.
account42 7 hours ago
Oh great, yet another tag you need to add to tell mobile browsers to do the right thing instead of fucking with your website for no reason.
jand 2 days ago
victorbjorklund 2 days ago
/* This is mostly intended for prototyping; please download the pattern and re-host for production environments. Thank you! */
kris-kay 2 days ago
thecosas 2 days ago
CharlesW 2 days ago
kris-kay 2 days ago
kris-kay 2 days ago
utopcell 2 days ago
It shows, this is awesome, especially that rice paper effect!
kris-kay 2 days ago
elpocko 2 days ago
kris-kay 2 days ago
Even so, I haven't found another glass generator that has a texture layer and box-shadow bevel, etc.
account42 7 hours ago
rpastuszak 2 days ago
This is a slight tangent, but 20 years ago I had a nightmare in which I got hit by a tram, died and travelled in time into a world where every computer was running Windows Vista. In other words, fair enough, you might be onto something here after all.
elpocko 2 days ago
I've never used OSX, but I would guess from screenshots that it didn't do dynamic layered gaussian blur of large screen regions in realtime, which would've been too much for the hardware of the year 2000.
rpastuszak 2 days ago
Also, those scrollbars were quite impressive for their time.
account42 7 hours ago
kris-kay 2 days ago
alberth 2 days ago
filter: blur(16px);
andrewingram 2 days ago
alberth 2 days ago
So it'd actually be the OP CSS that would perform worse than this single line.
kris-kay 2 days ago
ivape 2 days ago
suralind 2 days ago
kris-kay 2 days ago
xgpyc2qp 2 days ago
kris-kay 2 days ago
gvison 1 day ago
minaguib 2 days ago
Not a lot of web sites have made my Macbook M3 show signs of stress ;)
kris-kay 2 days ago
arfaaan 2 days ago
kris-kay 2 days ago
ramoz 2 days ago
anon115 24 hours ago
adamschwartz 2 days ago
Putting aside for the moment that I personally find Apple’s iOS 26 design objectionable[1], I don’t understand why `backdrop-filter: blur` is the focus of recent implementations jumping on the Liquid Glass hype train.
Using background blur to create UI layer separation (often in combination with darkening/saturation or other contrast enhancements) has been around for over a decade on iOS and almost as long on the web. So what’s new here?
Adding to my confusion, I’m a bit surprised folks here think this is so challenging in CSS. A few commenters have pointed to great implementations elsewhere, but I think they’re underselling them.
Plainly: the solution that involves `backdrop-filter: filter(#filter)` where `#filter` references an inline SVG embedded with `<feImage/>` and `<feDisplacementMap/>` works very convincingly well.
Check out this demo for example:
https://codepen.io/Mikhail-Bespalov/pen/MYwrMNy
This implementation choose to hard-code `<feImage href="data:image/png;base64,..."/>`. But if glass3d.dev chose to implement 3d highlights in a similar fashion (and wanted to support e.g. a dynamic `border-radius`) this image could easily be rendered in the browser runtime in canvas, and dumped into the CSS using `toDataURL()`. Similarly, a component library with a CSS pre-processor could generate these for any static shape at build-time.
The closest thing I’ve seen to this is:
These implementations are out there.
Coming back to the why/should for a second though.
[1] In its current realization, Liquid Glass cannot effectively replace what blur accomplishes. Because Liquid Glass layers are more transparent, the contrast issues are real, and the spectral highlights distract the eye as much as (or more than) they help make up for that lack of contrast. It draws attention to the eye where blur would relax it. It’s a UI meant for an XR system (where it arguably solves a real problem, much like a HUD does in a video game) hacked into devices where it makes no sense, all in the name of a “unified OS” design language.
If any aspect of Liquid Glass is successful it will be when it’s used sparingly to delight in places that are low stakes and where other affordances are present (like a small circular button floating in the corner of the screen with hardware concentricity). A circle shape’s refractions would be smaller, softer, more symmetrical, and therefore arguably less noisy/distracting—in a way resembling a softer blurry background.
Which brings me full circle back to two wrongs.
This website doesn’t do anything new, but that’s why it’s good. Because the truth is, Apple failed to deliver a Siri-based LLM on a schedule it announced and is now trying to distract us with some shiny new thing. Damn, it worked.
kris-kay 23 hours ago
I fully agree with you there. Though I like the Liquid Glass look overall, I think Apple is overusing it. It definitely shouldn’t be a background for paragraph-sized text (e.g., I can’t read half the text in banners on my phone).
Some context about this project:
- I’m not trying to recreate Liquid Glass (though happy to chat about it)
- Goal: Production-usable → must at least work on current (desktop and mobile) versions of Chrome, Safari, and Firefox, on both Apple and PC/Android devices
- Goal: Optimize the developer experience (more relevant to the glass SCSS library I’m working on) → ideally, people can add a class (plus an optional wrapper) and it just works in most tech stacks.
So my intended value adds are aesthetic polish and ease of use, rather than raw innovation.Thank you for sharing potential implementation solutions. I'll research them and see if I can wrangle them to work cross-browser.
Sander_Marechal 1 day ago
kris-kay 23 hours ago
refulgentis 2 days ago
Thus, the odds you're doing glass-morphism via a Gaussian blur and drop shadow in CSS, are exactly 0. They are assuredly at abstraction levels far below that.
(disclaimer: worked on Pixel, did the color extraction + color system stuff for Material You)
its-summertime 2 days ago
kris-kay 2 days ago
kris-kay 2 days ago
August7337 1 day ago
lovegrenoble 2 days ago
voidUpdate 1 day ago
sahil_sharma0 1 day ago
somgautam2077 2 days ago