{"id":6644,"date":"2025-07-28T21:57:16","date_gmt":"2025-07-29T02:57:16","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=6644"},"modified":"2025-07-28T21:57:17","modified_gmt":"2025-07-29T02:57:17","slug":"liquid-glass-on-the-web","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/liquid-glass-on-the-web\/","title":{"rendered":"Liquid Glass on the Web"},"content":{"rendered":"\n<p>Apple is going to version 26 across all its operating systems this fall, and with it, a new design aesthetic <a href=\"https:\/\/developer.apple.com\/documentation\/technologyoverviews\/liquid-glass\">they call\u00a0Liquid Glass<\/a>. This look is given &#8220;automatically&#8221; to native app developers using &#8220;standard components&#8221;. We&#8217;ve yet to see Apple&#8217;s take on delivering this look through web technology, but many web developers have had a crack already. Let&#8217;s take a look at how other&#8217;s have brought this design look to the web.<\/p>\n\n\n\n<p class=\"learn-more\">Note that the liquid glass look has been rightfully criticized for text contrast accessibility. This is When you set text over unknown backgrounds, other concessions must be made to ensure text accessibility by way of readability. Digital designers have known this for a long time, so it&#8217;s surprising to see it come up as seemingly such a surprise here and see Apple scramble through iterations as new Beta versions roll out. I mention this at the top because it may apply to any of the techniques we&#8217;ll look at here. Please be cautious.<\/p>\n\n\n\n<p>This can be a quite complex look to pull off on the web! Yes, we&#8217;ve got <code><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/backdrop-filter\">backdrop-filter<\/a><\/code> and that can be a nice effect that even alone bears some similarity here. But the full effect here is different. There is refracted light at play, edges with highlights, different degrees of frosted effects, and other manipulation of what is behind the glass, simulating what glass might do in real life.<\/p>\n\n\n\n<p>I&#8217;d also point you to <a href=\"https:\/\/css-tricks.com\/getting-clarity-on-apples-liquid-glass\/\">Geoff Graham&#8217;s rundown<\/a> on all this which is loaded with links.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Glass Displacement<\/h2>\n\n\n\n<p>While some liquid glass effects lean on a &#8220;frosted&#8221; effect (which can be quite helpful for text contract) Jhey Tompkins&#8217; Pen here showcases how there may be no frosted effect at all. The &#8220;glass&#8221; may be perfectly clear yet still refract the light and distort what you can see behind and through it. The effect here works great as there is no text on top to worry about the readiblity of. There is text <em>behind<\/em>, which is less important for readability as you can simply move it away.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_EajLxJV\" src=\"\/\/codepen.io\/anon\/embed\/EajLxJV?height=650&amp;theme-id=1&amp;slug-hash=EajLxJV&amp;default-tab=result\" height=\"650\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed EajLxJV\" title=\"CodePen Embed EajLxJV\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">SVG Blur and Displacement<\/h2>\n\n\n\n<p>Here is one that uses <code>backdrop-filter<\/code> as expected, but it&#8217;s not a simple blur as is most commonly seen. It uses the lesser-known ability of <code>backdrop-filter<\/code> to use <code>url()<\/code> and link to an SVG filter, in this case using both <code>feDisplacementMap<\/code> and <code>feGaussianBlur<\/code>. This makes a very unique light refraction look that is a different type of frosting than just color, all while not losing much color.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_XJbxKQq\" src=\"\/\/codepen.io\/anon\/embed\/XJbxKQq?height=450&amp;theme-id=1&amp;slug-hash=XJbxKQq&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed XJbxKQq\" title=\"CodePen Embed XJbxKQq\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">A React Component<\/h2>\n\n\n\n<p>Max Rovensky got in on this early, producing <a href=\"https:\/\/github.com\/rdev\/liquid-glass-react\">Liquid Glass React<\/a>, which provides a component with a bunch of props for controlling the exact look you&#8217;re after:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">LiquidGlass<\/span>\n  <span class=\"hljs-attr\">displacementScale<\/span>=<span class=\"hljs-string\">{64}<\/span>\n  <span class=\"hljs-attr\">blurAmount<\/span>=<span class=\"hljs-string\">{0.1}<\/span>\n  <span class=\"hljs-attr\">saturation<\/span>=<span class=\"hljs-string\">{130}<\/span>\n  <span class=\"hljs-attr\">aberrationIntensity<\/span>=<span class=\"hljs-string\">{2}<\/span>\n  <span class=\"hljs-attr\">elasticity<\/span>=<span class=\"hljs-string\">{0.35}<\/span>\n  <span class=\"hljs-attr\">cornerRadius<\/span>=<span class=\"hljs-string\">{100}<\/span>\n  <span class=\"hljs-attr\">padding<\/span>=<span class=\"hljs-string\">\"8px 16px\"<\/span>\n  <span class=\"hljs-attr\">onClick<\/span>=<span class=\"hljs-string\">{()<\/span> =&gt;<\/span> console.log('Button clicked!')}\n&gt;\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">className<\/span>=<span class=\"hljs-string\">\"text-white font-medium\"<\/span>&gt;<\/span>Click Me<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">LiquidGlass<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_NPGRLMY\" src=\"\/\/codepen.io\/editor\/anon\/embed\/NPGRLMY?height=450&amp;theme-id=1&amp;slug-hash=NPGRLMY&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed NPGRLMY\" title=\"CodePen Embed NPGRLMY\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>I think all those props showcase nicely just how complex all the &#8220;dials&#8221; are for liquid glass and how difficult it must be for Apple to turn them all the right amount under the right circumstances to minimize accessibility issues. You&#8217;ll face the same should you go down this path with a site! <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Atlas Pup Tutorial<\/h2>\n\n\n\n<p><a href=\"https:\/\/atlaspuplabs.com\/blog\/liquid-glass-but-in-css\">The pseudonymous Pup Atlas does a good job<\/a> of starting with and explaining <code>backdrop-filter<\/code> before jumping into the other effects needed, ultimately again with SVG filters, to do needed things like distortion.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player wp-block-jetpack-videopress--has-max-width\" style=\"max-width: 587px;\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='235' src='https:\/\/videopress.com\/embed\/R7h202Ke?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1739540970'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<h2 class=\"wp-block-heading\">More Demos!<\/h2>\n\n\n\n<p>I like the emphasized highlights in the Pen below, making it extra glass-like. The morphing selected option gives the liquid effect, and the background is blurred so heavily it seems unlikely to cause legibility contrast issues (but you&#8217;d still have to be careful about color contrast specifically).<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_KwpRaGr\" src=\"\/\/codepen.io\/anon\/embed\/KwpRaGr?height=450&amp;theme-id=1&amp;slug-hash=KwpRaGr&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed KwpRaGr\" title=\"CodePen Embed KwpRaGr\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>Here&#8217;s another example where there is no blur at all, and the frosting is only in the form of a very light transluent white. But distortion is on fully display making it quite glassy. Perhaps on purpose, you can see how the &#8220;Artist&#8221; part below (&#8220;Nao&#8221;) becomes hard to read at certain points of the scroll movement.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_yyNvNGQ\" src=\"\/\/codepen.io\/anon\/embed\/yyNvNGQ?height=450&amp;theme-id=1&amp;slug-hash=yyNvNGQ&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed yyNvNGQ\" title=\"CodePen Embed yyNvNGQ\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>The light distortion can implemented strongly enough that in the example below you can see some of the refracted wallpaper appear as if it&#8217;s moving upward while underneath the navbar elements as wallpaper otherwise is moving downward.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_vEOpqMa\" src=\"\/\/codepen.io\/anon\/embed\/vEOpqMa?height=450&amp;theme-id=1&amp;slug-hash=vEOpqMa&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed vEOpqMa\" title=\"CodePen Embed vEOpqMa\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>When we talk about &#8220;frosted&#8221; glass typically it just means extra blurring and perhaps a light color overlay, but here the frosting is actually textured which is relatively common in real life glass usage, like office doors and shower sliders. <\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_qEBmggz\" src=\"\/\/codepen.io\/anon\/embed\/qEBmggz?height=450&amp;theme-id=1&amp;slug-hash=qEBmggz&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed qEBmggz\" title=\"CodePen Embed qEBmggz\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>These water droplets below are made with largely the same techniques as we&#8217;ve seen so far, but really dialed up to 11 with <em>loads<\/em> of <code>box-shadow<\/code> both in and out. Usually in Liquid Glass, the shadows aren&#8217;t particularly as heavy, but of course, it looks great here. It makes me think if this visual language is really more about the liquid than the glass.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_KKVbQmV\" src=\"\/\/codepen.io\/anon\/embed\/KKVbQmV?height=450&amp;theme-id=1&amp;slug-hash=KKVbQmV&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed KKVbQmV\" title=\"CodePen Embed KKVbQmV\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s a complicated look! There may or may not be blurring, light refracts in tricky ways, the highlights are quite bright, and you&#8217;ve got to be very careful about text contrast accessibility.<\/p>\n","protected":false},"author":1,"featured_media":6656,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[7,378,91],"class_list":["post-6644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-post","tag-css","tag-liquid-glass","tag-svg"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/07\/Liquid-Glass-on-the-Web.jpg?fit=1140%2C676&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=6644"}],"version-history":[{"count":9,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6644\/revisions"}],"predecessor-version":[{"id":6657,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6644\/revisions\/6657"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/6656"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=6644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=6644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=6644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}