How to use the glassmorphism generator
- Pick a preset: light frosted glass, dark smoke, tinted colors, grain textures or shape variations.
- Choose a preview background that resembles what will sit behind the panel on your site.
- Tune the glass: tint color and opacity, blur strength and saturation. Grain adds a subtle texture.
- Shape the edge: border color and opacity, corner radius and shadow.
- Set the text color and watch the contrast check.
- Copy CSS, SCSS or Tailwind.
Getting glass right
- It needs something behind it. Glass over a flat color just looks grey. Place it over images, gradients or shapes.
- Use saturation. A 150–200% saturation boost keeps colors behind the glass vivid instead of muddy.
- Use a light edge. A 1px border in white at 20–40% opacity catches the light and defines the shape.
- Choose an opacity. Light tints work at 10–30%; dark tints need 40–70% to keep text readable.
Accessibility
Translucent backgrounds are the main risk: text that passes over a dark part of a photo can fail over a bright part. Test the panel over the real content, and keep important text on panels with enough tint opacity.
How it works
The frosted look comes from backdrop-filter, which blurs and adjusts whatever sits behind the panel. A semi-transparent background tint, a thin light border and an optional grain texture make the glass edge readable. Browsers without backdrop-filter get a more opaque fallback background through an @supports rule, so text stays legible. The contrast check measures your text against the tint over the preview background, which is why it changes when the background does.
Worked examples
Example 1: a login card over a photo
Load iOS and choose the Photo background. A 55% white tint with a 30px blur and 200% saturation keeps the scene visible but calm, and dark text easily passes contrast. Increase the radius to 28px for a modern, app-like look.
Example 2: a navigation bar over a gradient hero
Load Frosted with the Sunset background, lower the radius to 0 and the shadow to 0. Stick it to the top of the page with position: sticky. As content scrolls underneath, the blur keeps the menu readable. Check contrast over both the lightest and darkest part of your hero image.
Example 3: a dark dashboard widget
Load Smoke on the Aurora background. A 45% navy tint with a faint white edge works well on dark themes. Add the grain texture for a subtle, tactile surface that hides banding in the blurred background.
Common mistakes
- Too little tint: 5–10% opacity looks great in a mockup but fails contrast on busy photos.
- Glass on glass: stacked translucent panels get muddy; give inner elements solid backgrounds.
- Forgetting the fallback: without it, older browsers show a see-through panel.