nutilz
๐ŸชŸ

Glassmorphism CSS Generator

Build frosted-glass and liquid glass CSS effects visually

Live Preview

Preview uses a gradient background to show the blur effect

Controls

Glass Color#ffffff
Background Opacity0.15
Blur Radius12px
Border Radius16px
Border Opacity0.20
Shadow Blur32px
Shadow Opacity0.10

Generated CSS

.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

Tailwind CSS equivalent

backdrop-blur-[12px] bg-[#ffffff]/15 border border-[#ffffff]/20 rounded-[16px] shadow-[0_8px_32px_rgba(0,0,0,0.1)]

๐Ÿ”’ No upload โ€” runs entirely in your browser. Your data never leaves your device.

What is Glassmorphism?

Glassmorphism is a visual design language that makes UI elements appear as though they are made of frosted glass โ€” semi-transparent, softly blurred panels that float above a colourful background. The name combines "glass" with "-morphism," following in the footsteps of skeuomorphism and flat design as a major UI trend cycle. When done well, the style creates a layered sense of depth while maintaining legibility, making it popular for dashboard cards, modals, navigation bars, and hero sections.

The trend surged in 2020 with macOS Big Sur, which brought translucent, blurred panels into Apple's system UI. It received a second major wave in 2025 when Apple introduced Liquid Glass at WWDC โ€” a physics-based evolution of glassmorphism used throughout iOS 26 and macOS Tahoe. In 2026, glassmorphism and liquid glass are more popular than ever, appearing in web apps, landing pages, SaaS dashboards, and mobile UI kits worldwide.

The Five CSS Properties Behind Glassmorphism

Every glassmorphism effect is built from five CSS declarations working in concert. Understanding what each one does gives you the control to tune the effect precisely.

  1. 1. background: rgba() โ€” Sets the glass colour and transparency. A typical frosted-white card uses rgba(255, 255, 255, 0.15). Keeping opacity below 0.30 preserves the translucent look; above 0.50 the element becomes too opaque to read as glass.
  2. 2. backdrop-filter: blur() โ€” Blurs every pixel of the content visible through the element. This is what creates the "frosted" appearance. Values between 8 px and 20 px work best; above 30 px the background becomes unrecognisably blurred. Add -webkit-backdrop-filter: blur() as well for Safari compatibility.
  3. 3. border-radius โ€” Softens the shape of the glass panel. The standard glassmorphism look uses border-radius: 16px. Increase it for pill-shaped elements or reduce it to zero for sharp architectural UI designs.
  4. 4. border: 1px solid rgba() โ€” A thin, semi-transparent border that catches light and mimics the polished edge of real glass. Match the border colour to the glass colour (e.g., white border for white glass) but use a higher opacity than the background โ€” typically 0.20 to 0.35.
  5. 5. box-shadow โ€” Adds depth and separates the glass card from the layer below. A soft, low-opacity black shadow (rgba(0, 0, 0, 0.10)) works for most designs. Avoid heavy shadows โ€” they contradict the airy lightness of the glassmorphism aesthetic.

How to Use This Generator

  1. 1.Click the colour swatch or type a hex value to set your glass colour. White (#ffffff) is the classic choice; try dark colours for a smoky glass effect.
  2. 2.Drag the Background Opacity slider to control how transparent the panel is. Around 0.10โ€“0.20 gives the most glassy look.
  3. 3.Adjust Blur Radius until the background is pleasantly frosted without losing all detail (8โ€“20 px is the sweet spot).
  4. 4.Set Border Radius and Border Opacity to match your card's design system.
  5. 5.Toggle the shadow on or off and fine-tune its intensity.
  6. 6.Click "Copy CSS" to copy the production-ready CSS directly to your clipboard.

Glassmorphism vs Apple Liquid Glass in 2026

When Apple revealed Liquid Glass at WWDC 2025 for iOS 26 and macOS Tahoe, it reignited interest in translucent UI design. But Liquid Glass is technically distinct from classic glassmorphism. A classic frosted glass card is a flat, static panel โ€” backdrop-filter blurs the background uniformly and the result looks like a sheet of frosted glass. Liquid Glass adds physical-material behaviour: the glass refracts and bends light passing through it, creating a specular highlight ring around the element's edge and subtle lensing distortion that responds to the content moving behind it.

In pure CSS you can approximate Liquid Glass by pairing backdrop-filter: blur() with filter: brightness(1.05) saturate(1.2) and replacing the flat border with a gradient border using a pseudo-element. True physics-based light bending, however, requires an SVG feTurbulence displacement filter or a WebGL shader โ€” both of which are out of scope for a plain CSS card. For most production web UIs, the CSS approximation is close enough and vastly more compatible.

Real-World Use Cases with Worked Examples

1. Dashboard Stats Card

A SaaS dashboard with a full-bleed gradient background benefits hugely from glassmorphism cards. Each metric card sits above the gradient, its frosted background letting the underlying colour through while keeping the text perfectly legible. Set blur to 16 px and opacity to 0.12 for a subtle, professional look. Keep the text contrast ratio above 4.5:1 by testing your card on the actual gradient โ€” do not assume the blur makes text harder to read, because the background colour does bleed through the opacity.

2. Fixed Navigation Bar

A sticky navigation bar with glassmorphism creates a polished "floating" effect that lets page content scroll naturally behind it. Set position: fixed; top: 0; width: 100%; z-index: 50 along with the glass CSS. Use a lower opacity (0.08โ€“0.12) than a card so the nav bar feels lightweight. Add a very subtle bottom border in the same glass colour at 0.25 opacity to define the edge. The gradient or hero image scrolling behind the nav bar acts as the dynamic background โ€” no extra markup needed.

3. Modal or Dialog Overlay

A glassmorphism modal placed above a blurred page backdrop creates a layered depth effect. Dim the page with a semi-transparent dark overlay (background: rgba(0,0,0,0.4)) and apply the glass card styles to the modal panel. Use a higher blur (20โ€“24 px) and slightly higher opacity (0.20โ€“0.25) than a card so the modal has clear visual priority. The interplay between the dark overlay and the frosted modal panel is one of the most striking uses of glassmorphism in modern UI.

Tailwind CSS Glassmorphism Cheat Sheet

EffectTailwind Classes
Subtle white glassbackdrop-blur-sm bg-white/10 border border-white/15 rounded-2xl
Classic frosted glassbackdrop-blur-md bg-white/15 border border-white/20 rounded-2xl shadow-lg
Strong glassbackdrop-blur-xl bg-white/20 border border-white/25 rounded-2xl shadow-xl
Dark glassbackdrop-blur-md bg-black/20 border border-white/10 rounded-2xl shadow-lg
Coloured glassbackdrop-blur-md bg-indigo-500/15 border border-indigo-300/20 rounded-2xl

Browser Compatibility and Graceful Degradation

backdrop-filter reached about 97% global browser support in 2024. Chrome, Edge, Safari, and all Chromium-based mobile browsers have shipped it for years. Firefox added support in version 103 (July 2022), so virtually all active Firefox installations now support it. The one browser family where support can still be an issue is certain WebView contexts in older Android apps.

For the remaining 3%, always design a readable fallback. Because backdrop-filter is additive โ€” it enhances an element that already has a background colour โ€” the fallback is free: a browser that cannot apply the blur simply renders the background: rgba() alone. The card still looks like a coloured transparent panel rather than a glass one, which is usually acceptable. If your design depends heavily on legibility through the glass, increase the fallback opacity with an @supports block:

@supports not (backdrop-filter: blur(1px)) {
  .glass {
    background: rgba(255, 255, 255, 0.65);
  }
}

Frequently Asked Questions

What is glassmorphism in CSS?+
Glassmorphism is a UI design trend that makes elements look like frosted-glass panels โ€” semi-transparent backgrounds with a blurred view of whatever sits behind them. In CSS it is achieved with three properties working together: background: rgba() sets the tinted, semi-transparent fill; backdrop-filter: blur() blurs every pixel visible through the element (a colorful background behind the card is required to see the effect); and a thin, partially transparent border: 1px solid rgba() mimics the polished edge of a glass panel. An optional box-shadow adds depth. The style was popularised by macOS Big Sur in 2020 and extended by Apple's Liquid Glass design language introduced in iOS 26 and macOS Tahoe at WWDC 2025.
What is the difference between glassmorphism and Apple's Liquid Glass?+
Classic glassmorphism uses backdrop-filter: blur() to create a static frosted-sheet look โ€” the element appears as a flat, translucent panel. Apple's Liquid Glass (WWDC 2025, iOS 26 and macOS Tahoe) adds physical-material simulation: the glass bends and refracts the light passing through it, producing a specular-highlight ring around the edges and a subtle lensing distortion that shifts as the user scrolls. In pure CSS you can approximate the Liquid Glass look by combining backdrop-filter: blur() with filter: brightness(1.05) saturate(1.2) and a gradient border, but true physics-based refraction requires WebGL or an SVG displacement filter. This generator outputs both the simple frosted-glass CSS and an enhanced liquid-glass approximation using only accessible web standards.
Is backdrop-filter supported in all browsers?+
As of 2026, backdrop-filter is supported in all major browsers: Chrome 76+, Firefox 103+, Safari 9+ (with the -webkit-backdrop-filter prefix), Edge 79+, and all modern mobile browsers. Global support is approximately 97%. The only significant gap is older Firefox โ€” Mozilla did not ship backdrop-filter until version 103 (2022). For unsupported browsers, the frosted-glass effect degrades gracefully to the solid background: rgba() value because backdrop-filter is a pure visual enhancement. Always verify your fallback looks acceptable by temporarily removing the backdrop-filter line.
What background works best for glassmorphism effects?+
Glassmorphism requires a visually rich, colourful background behind the card โ€” a plain white or grey page makes backdrop-filter: blur() produce a dull, washed-out result. The most effective choices are: vivid CSS linear or radial gradients (two or more contrasting colours), full-viewport hero images with clear colour variation across the frame, or overlapping geometric shapes in different colours. High contrast between the glass card and the background content behind it makes the frosted illusion most convincing. For white glass, use a dark or heavily saturated gradient as the background. For dark glass, use a brighter background.
How do I add glassmorphism to a Tailwind CSS card?+
Tailwind CSS includes the necessary utilities out of the box. A minimal glassmorphism card looks like: <div class="backdrop-blur-md bg-white/10 border border-white/20 rounded-2xl shadow-lg p-6">. backdrop-blur-md applies 12 px of blur, bg-white/10 sets a 10 % white background, border-white/20 adds a 20 % white border, and rounded-2xl gives 16 px border radius. For an exact pixel blur value outside the default scale, use an arbitrary value: backdrop-blur-[12px]. In Tailwind v4, all backdrop-blur utilities are built in. In Tailwind v3 with JIT mode, arbitrary values also work without any plugin.
How do I create a glassmorphism fallback for older browsers?+
Use the @supports rule to detect backdrop-filter and provide a more opaque fallback: @supports not (backdrop-filter: blur(1px)) { .glass { background: rgba(255, 255, 255, 0.65); } }. Without the blur, a more opaque background keeps the card readable. A second technique that works in every browser is to position a blurred duplicate of the background using a ::before pseudo-element with filter: blur() and overflow: hidden, but this requires knowing the background image or colour. The @supports approach is simpler, more maintainable, and sufficient for the small percentage of users on browsers that lack backdrop-filter support.