💎 UI Design Studio

CSS Glassmorphism & Neumorphism Generator

Design frosted glass card overlays (Glassmorphism) and soft extruded UI elements (Neumorphism) with real-time CSS code export.

Live UI Canvas
Frosted CardGlass UI

Modern Backdrop Blur

Translucent UI Layer

Backdrop Blur12px
Background Transparency20%
Border Opacity30%
Generated CSS Code
background: rgba(255, 255, 255, 0.20);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.30);
border-radius: 20px;

What makes glass look like glass

Glassmorphism relies on backdrop-filter: blur(), which blurs whatever is painted behind the element rather than the element itself. On its own the blur is invisible over a flat colour; the effect only appears when there is something with detail behind the card, such as a photo, a gradient or overlapping shapes. If your glass card looks like a plain white box, the background is the problem, not the CSS.

Three values carry the look. The blur radius softens the backdrop, a low-alpha white background tints it, and a thin semi-transparent white border catches the light along the edge. The generated rule also includes -webkit-backdrop-filter because older Safari versions only recognise the prefixed property.

Worked example: what colour the reader actually sees

A semi-transparent background is blended with whatever lies behind it using simple alpha compositing: result = alpha x foreground + (1 - alpha) x background, per colour channel. With the default 20% background, rgba(255, 255, 255, 0.20), over a dark navy page of #0f172a (15, 23, 42), the red channel becomes 0.2 x 255 + 0.8 x 15 = 63. Green comes out at about 69 and blue at about 85, so the card reads as roughly rgb(63, 69, 85).

That number is what matters for text contrast. White text on that blended colour has plenty of contrast, but the same card over a bright photo might blend to near white, and white text would vanish. When the backdrop varies, test the worst-case area, or raise the background alpha so the card is opaque enough to carry its text on its own.

How neumorphic shadows create depth

Neumorphism fakes a light source at the top left. The element uses the same background as the surface it sits on, then gets two shadows: a darker one offset down and right (#a3b1c6 here) and a white one offset up and left. The eye reads that pairing as a shape raised out of the surface. Adding the inset keyword to both shadows flips the illusion, so the element looks pressed in.

Because the element and the surface share one colour, the shadows are the only thing defining its edge. That is the style's main weakness. On the default #e0e5ec surface, the dark shadow colour #a3b1c6 has a contrast ratio of only about 1.7 to 1 against the background, well short of the 3 to 1 that WCAG 2.1 asks for on the visual boundary of interactive controls.

Using both styles without hurting usability

Treat both effects as decoration on top of a layout that already works. A few practical rules keep them usable:

  • Do not rely on a neumorphic edge alone to show that something is a button. Add a label, an icon or a visible outline on focus.
  • Check text colours against the neumorphic background. A mid grey like #6b7280 on #e0e5ec measures about 3.8 to 1, below the 4.5 to 1 needed for normal-size body text.
  • Keep backdrop blur to a few large surfaces, such as a header or a modal. Every blurred layer must be re-rendered as content scrolls beneath it, which costs battery and frame rate on phones.
  • Provide a fallback background for browsers or settings where backdrop-filter is unavailable, using @supports not (backdrop-filter: blur(1px)) to swap in a more opaque colour.

Glassmorphism & Neumorphism: frequently asked questions

Why does backdrop-filter do nothing on my element?

The usual cause is that nothing with visible detail sits behind the element, or the element's background is fully opaque. The background must be partly transparent for the blurred backdrop to show through. Also check that no ancestor clips or isolates the content you expect to see blurred.

Is glassmorphism bad for performance?

It can be. The browser must re-blur the backdrop whenever content behind it changes, including during scrolling. One or two glass panels are usually fine; dozens of blurred cards in a long list can cause dropped frames on lower-end devices.

Does neumorphism work in dark mode?

It can, but the light shadow must be a slightly lighter tone of the dark surface rather than pure white, and the dark shadow a near-black version of it. Contrast problems are often worse on dark surfaces, so test interactive states carefully.

Why do neumorphic shadows look wrong on a white or coloured page?

The illusion needs the element and its surroundings to share the same mid-tone colour, so both a lighter and a darker shadow are visible. On a pure white page the white highlight disappears. Set the parent's background to the same colour as the element.

All css & visual generators