backdrop-filter unlocks glassmorphism and other frosted-glass effects in CSS, but tweaking 9 different filter functions by hand is tedious. I built a visual generator with live sliders so you can see the result in real time.
Tool
CSS Backdrop Filter Generator
https://devnestio.pages.dev/css-backdrop-filter/
Sliders for all 9 filter functions, live preview on a glassmorphism card, 5 presets, and auto-generates the -webkit- prefix for Safari.
How backdrop-filter Works
Unlike filter which affects the element itself, backdrop-filter applies to the area behind the element:
.glass {
/* The element needs to be semi-transparent */
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 16px;
/* This blurs/filters what is behind the element */
backdrop-filter: blur(12px) brightness(110%) saturate(160%);
-webkit-backdrop-filter: blur(12px) brightness(110%) saturate(160%);
}
Key requirement: there must be content behind the element for the filter to be visible. A solid opaque background will show nothing.
The 9 Filter Functions
| Function | Range | Effect |
|---|---|---|
blur(Npx) |
0 to 40px | Gaussian blur |
brightness(N%) |
0 to 200% | Lighten or darken (100% = default) |
contrast(N%) |
0 to 200% | Increase or decrease contrast |
grayscale(N%) |
0 to 100% | Desaturate |
hue-rotate(Ndeg) |
0 to 360deg | Rotate colors on the hue wheel |
invert(N%) |
0 to 100% | Invert colors |
opacity(N%) |
0 to 100% | Transparency |
saturate(N%) |
0 to 300% | Boost or reduce color intensity |
sepia(N%) |
0 to 100% | Warm brownish tone |
Combine them with spaces (not commas):
backdrop-filter: blur(8px) brightness(90%) saturate(180%);
The 5 Presets
Frosted Glass (classic glassmorphism)
.frosted {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 16px;
backdrop-filter: blur(12px) brightness(110%) saturate(160%);
-webkit-backdrop-filter: blur(12px) brightness(110%) saturate(160%);
}
Dark Overlay
.dark-overlay {
backdrop-filter: blur(8px) brightness(40%) contrast(120%);
-webkit-backdrop-filter: blur(8px) brightness(40%) contrast(120%);
}
Vintage
.vintage {
backdrop-filter: sepia(60%) contrast(110%) brightness(90%) saturate(80%);
-webkit-backdrop-filter: sepia(60%) contrast(110%) brightness(90%) saturate(80%);
}
Noir
.noir {
backdrop-filter: grayscale(100%) contrast(130%) brightness(80%);
-webkit-backdrop-filter: grayscale(100%) contrast(130%) brightness(80%);
}
Browser Support
| Browser | Version |
|---|---|
| Chrome | 76+ |
| Edge | 79+ |
| Firefox | 103+ |
| Safari | 9+ (needs -webkit- prefix) |
Always include both properties. The tool generates both automatically.
Performance Tips
Strong blur values are GPU-intensive. For animated or many glassmorphism elements:
.glass {
/* Hint to the browser to promote to compositor layer */
will-change: backdrop-filter;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
Top comments (0)