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
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. 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. 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. 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. 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. 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.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.Drag the Background Opacity slider to control how transparent the panel is. Around 0.10โ0.20 gives the most glassy look.
- 3.Adjust Blur Radius until the background is pleasantly frosted without losing all detail (8โ20 px is the sweet spot).
- 4.Set Border Radius and Border Opacity to match your card's design system.
- 5.Toggle the shadow on or off and fine-tune its intensity.
- 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
| Effect | Tailwind Classes |
|---|---|
| Subtle white glass | backdrop-blur-sm bg-white/10 border border-white/15 rounded-2xl |
| Classic frosted glass | backdrop-blur-md bg-white/15 border border-white/20 rounded-2xl shadow-lg |
| Strong glass | backdrop-blur-xl bg-white/20 border border-white/25 rounded-2xl shadow-xl |
| Dark glass | backdrop-blur-md bg-black/20 border border-white/10 rounded-2xl shadow-lg |
| Coloured glass | backdrop-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?+
What is the difference between glassmorphism and Apple's Liquid Glass?+
Is backdrop-filter supported in all browsers?+
What background works best for glassmorphism effects?+
How do I add glassmorphism to a Tailwind CSS card?+
How do I create a glassmorphism fallback for older browsers?+
Related Tools
CSS Box Shadow Generator
Build CSS box shadows visually with multiple layers and presets.
CSS Gradient Generator
Build linear, radial and conic CSS gradients visually.
Color Picker
Pick any color and get HEX, RGB, HSL values and palettes.
CSS Text Shadow Generator
Build CSS text-shadow effects visually with live preview.
CSS Grid Generator
Build CSS grid layouts visually and copy the generated CSS instantly.