What the Glass Effect Generator does
The Glass Effect Generator makes the frosted-glass look used in modern interfaces, where a card blurs whatever is behind it. Set the blur, how see-through the glass is, its colour, a colour boost, the strength of its light edge, the corner radius and a shadow, and test it over colourful, light and dark backgrounds. The CSS includes the -webkit- line Safari needs.
How to use it
- Choose a background to test on.
- Set the blur, transparency and glass colour.
- Adjust the colour boost, edge, corners and shadow.
- Copy the CSS.
Example
The default writes background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 20px; plus a soft shadow. Over the aurora background the colour blobs show through the card as soft glows.
Using glass well
Glass needs something interesting behind it: on a plain background it looks like a faint grey box. It works best over photos, gradients or blurred shapes, for navigation bars, cards and dialogs.
Text on glass can lose contrast as the background moves or scrolls. Use white text with a slight shadow on dark scenes, raise the fill to 25–40% behind small text, and check important text with the Contrast Checker against the lightest and darkest parts behind it.
Where the effect is not supported or is switched off, the card simply shows its see-through fill without the blur, so the content stays readable.
Questions people ask
Is anything uploaded?
No. Everything is worked out in your browser, so your colours, designs and images stay on your device.
Which browsers support backdrop-filter?
Every current browser. Safari needs the -webkit-backdrop-filter line, which is included.
What does the colour boost do?
saturate() makes the colours seen through the glass richer, which keeps it from looking washed out.
Does blur affect speed?
Large blurs over big areas cost more on low-end phones. Keep glass to cards and bars rather than whole pages.