Glassmorphism with Optimal Performance
Modern frosted glass effects with backdrop-filter that don't tank your frame rate. Allegedly.
Performance warning
backdrop-filter: blur() is expensive. Use sparingly, keep blur radius modest (≤20px), and test on actual devices. Your M3 MacBook is not representative of reality.
The Problem
Glassmorphism became trendy around 2020 when macOS Big Sur introduced frosted-glass UI elements everywhere. Designers loved it. CPUs did not.
The backdrop-filter property lets you apply blur and other effects to whatever is behind an element. This requires the browser to:
- Render everything behind the glass element
- Apply the blur filter to that rendered content
- Composite the blurred result with the glass element on top
This happens on every frame. If you have multiple glass elements, large blur radii, or complex backgrounds, performance degrades quickly.
The Solution
Use glassmorphism strategically. Small elements, modest blur, and minimal layering. Think navigation bars and modal overlays, not entire page backgrounds.
Live Demo
Glass Card
This card uses backdrop-filter: blur(12px)to create a frosted glass effect. Notice how the background shows through but remains blurred.
backdrop-filter: blur(12px)
background: rgba(255, 255, 255, 0.1)
Basic Implementation
The core technique combines backdrop-filter with a semi-transparent background and subtle borders. Here's the minimal viable glass:
.glass-card {
/* The magic */
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px); /* Safari */
/* Semi-transparent background */
background: rgba(255, 255, 255, 0.1);
/* Subtle border for definition */
border: 1px solid rgba(255, 255, 255, 0.2);
/* Rounded corners (optional) */
border-radius: 16px;
/* Shadow for depth */
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}Dark Mode Variant
For dark backgrounds, invert the transparency and use darker borders:
.glass-card-dark {
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
/* Darker, more opaque */
background: rgba(0, 0, 0, 0.4);
/* Darker border */
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}Performance Optimizations
If you must use glassmorphism, follow these guidelines to minimize the damage:
- Keep blur radius ≤ 16px – Larger values are exponentially more expensive.
- Limit the number of glass elements – Each one triggers a full re-render of its background.
- Avoid animating backdrop-filter – Transitioning blur values is performance suicide.
- Use
will-changesparingly – It can help, but overuse creates more problems than it solves. - Consider static alternatives – Sometimes a simple semi-transparent background without blur looks nearly as good and performs infinitely better.
.glass-card-optimized {
/* Modest blur radius */
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
/* Slightly more opaque to reduce blur dependency */
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 12px;
/* Only use will-change if animating transform/opacity */
/* will-change: transform; */
}
/* Disable on reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
.glass-card-optimized {
backdrop-filter: none;
background: rgba(255, 255, 255, 0.25);
}
}Browser Support
backdrop-filter is supported in all modern browsers (Chrome, Firefox, Safari, Edge). The -webkit- prefix is needed for Safari. IE11 doesn't support it, but if you're still supporting IE11 in 2025, glassmorphism is the least of your concerns.
Fallback Strategy
For browsers without backdrop-filter support, provide a more opaque background as a fallback:
.glass-card-safe {
/* Fallback: more opaque, no blur */
background: rgba(255, 255, 255, 0.3);
/* Progressive enhancement */
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 16px;
}
/* Feature detection in JS (optional) */
@supports (backdrop-filter: blur(1px)) {
.glass-card-safe {
background: rgba(255, 255, 255, 0.1);
}
}When Not to Use This
- Low-end devices – Glassmorphism is a luxury feature. Test on mid-range Android phones before deploying.
- Complex animations – Don't animate blur values. Don't layer multiple glass elements on top of each other. Don't do both.
- Large areas – A full-screen glass overlay will destroy performance. Use for small UI elements only.
- Accessibility concerns – Blurred backgrounds can reduce readability. Ensure sufficient contrast and respect
prefers-reduced-motion.
Further Reading
Glassmorphism looks impressive in design mockups. In production, it requires careful consideration, testing, and restraint. Use it for accent elements, not structural UI.
When in doubt, a simple semi-transparent background without blur will serve you better.