A CSS glassmorphism generator builds the frosted-glass UI effect made famous by macOS Big Sur, iOS, and Windows 11. The trick is combining backdrop-filter: blur(), partial transparency, and a subtle 1px border.
This guide covers the recipe, browser support, and design rules to keep glassmorphism elegant rather than tacky.
Generate Glassmorphism CSS — Free
Frosted glass effect with live preview. Copy-paste ready.
The Glassmorphism Recipe
.glass {
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
Five ingredients:
- Transparent background — 10-25% white over the underlying color.
- Backdrop blur — 8-20px blur radius.
- Subtle border — 1px white at low opacity for "edge of glass".
- Rounded corners — 12-24px feels modern.
- Soft shadow — 0 8px 32px gives lift without harshness.
Why You Need a Colorful Background
Glassmorphism only works if there's something interesting behind the glass. On a flat white page, blur has nothing to blur — the effect disappears.
Common backdrops:
- Gradient mesh or radial blobs
- Photographic hero image
- Animated gradient
- Multiple colored shapes positioned absolutely
Glassmorphism in Dark Mode
.glass-dark {
background: rgba(0, 0, 0, 0.25);
backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.1);
}
For dark themes, swap to a translucent black background. The white border at lower opacity still works to define the edge.
Browser Support
- Chrome, Edge, Firefox 103+ — Full support.
- Safari — Needs
-webkit-backdrop-filterprefix. - Older Firefox — Falls back to solid background; provide a fallback color.
- Performance — Backdrop blur is GPU-intensive; avoid stacking many glass layers on mobile.
Design Rules
- Don't put text directly over the glass without sufficient contrast — use a slightly darker background tint.
- Limit to 1-2 glass elements per screen — overuse looks chaotic.
- Use brighter, saturated backgrounds; muted ones make the glass invisible.
- Pair with crisp typography and thin lines to feel "premium" rather than "soft".
- Test in both light and dark modes if your theme supports both.
How to Use the Tool (Step by Step)
- 1
Set Background Tint
Pick base color and opacity (10-25%).
- 2
Adjust Blur
Slide between 8-20px backdrop blur.
- 3
Add Border
White at low opacity for the glass edge.
- 4
Tune Shadow & Radius
Soft shadow + 16px corners.
- 5
Copy CSS
Paste into your stylesheet.
Frequently Asked Questions
Why doesn't glassmorphism work on my page?+−
You probably have a flat solid background. Blur needs something visually interesting to blur. Add a gradient or image behind it.
Is glassmorphism bad for accessibility?+−
It can be — text contrast often suffers. Use a slightly stronger background tint behind text and meet WCAG AA contrast ratios.
Does backdrop-filter work in Safari?+−
Yes, with the -webkit-backdrop-filter prefix. Most generators include both.
Will it slow my site down?+−
Backdrop blur is GPU-intensive on mobile. Limit to 1-2 elements and avoid animating it.
Can I combine glass with gradients?+−
Yes — use a gradient as the background of the glass element instead of a solid rgba.
Generate Glassmorphism CSS — Free
Frosted glass effect with live preview. Copy-paste ready.
Open Glassmorphism Generator ->Related Guides
CSS Gradient Generator
Generate linear, radial, and conic CSS gradients visually — copy the code and use it instantly in your projects.
CSS Neumorphism Generator Guide
Build the soft, extruded neumorphism look with twin shadows — and learn when to use it (and when not to).
Box Shadow Generator Guide
Create beautiful CSS box-shadow effects visually. Learn shadow anatomy, layered shadows, material design elevations, and performance tips.