Glassmorphism vs Neumorphism: CSS Design Guide
What Are These Design Trends?
Glassmorphism simulates frosted glass — translucent elements with blurred backgrounds. Apple popularized this in macOS and iOS. Neumorphism simulates objects extruded from the surface using paired light and dark shadows.
Both create depth and tactility through different optical illusions. Glassmorphism is transparent and layered. Neumorphism is opaque and monolithic.
How Glassmorphism Works
The core is backdrop-filter: blur(). This blurs whatever sits behind the element. Combined with a semi-transparent background (10-30% opacity), the element becomes a frosted pane.
backdrop-filter in version 18 (September 2024); Safari and iOS Safari 9 to 17 only read -webkit-backdrop-filter, so keep the prefixed line while you still support them. Chrome 76+, Edge 79+ and Firefox 103+ need no prefix (MDN browser compatibility data, checked October 2026).A subtle border (1px solid rgba(255,255,255,0.18)) adds a glass-edge highlight. Without it, the element blends too seamlessly into the background.
Glassmorphism CSS Deep Dive
Include both -webkit-backdrop-filter and backdrop-filter for Safari compatibility. Test across browsers — rendering differs slightly.
Glassmorphism requires a visually interesting background. A solid white page with glass on top looks broken, not frosted.
How Neumorphism Works
Neumorphism casts two opposing shadows — light and dark — on a background matching the element color. The illusion is the element is part of the surface.
Inset shadows create a pressed-in effect for inputs. Outset shadows create a raised effect for buttons.
Neumorphism CSS Deep Dive
The formula: two box-shadows. One lighter than background, one darker. A #e0e0e0 background uses #ffffff and #bebebe shadows.
Shadow offset should equal in both directions (5-10px). Blur radius should be double the offset.
Side-by-Side Comparison
The two styles fail in opposite ways. Glass depends on what is behind it: the same panel can be readable over a dark photo and unreadable over a bright one, because backdrop-filter: blur() averages the colors underneath rather than hiding them. Neumorphism depends on what is around it: the element is the same color as the page, so only its two soft shadows mark where it starts and ends.
Worked Example: The Contrast Numbers
We computed WCAG 2.2 contrast ratios for the CSS in this guide (relative luminance formula from the WCAG definition, October 13, 2026).
Neumorphism. The classic recipe above puts #bebebe and #ffffff shadows on a #e0e0e0 surface. The dark shadow is 1.41:1 against the surface and the light one 1.32:1. WCAG success criterion 1.4.11 (Non-text Contrast, level AA) asks for 3:1 for the visual information needed to identify a control and its state, so a neumorphic button whose only edge is its shadow fails it by a wide margin. On a #e0e0e0 surface you would need a shadow or border at #7f7f7f or darker to reach 3:1 — at which point the soft look is gone. The practical fix is a visible border or icon with real contrast on every control, and a pressed state that changes more than the shadow direction.
Glassmorphism. A white glass layer at opacity a lightens whatever color shows through. Text contrast for white and for near-black (#0B0D17) text on a panel over five backdrop colors:
| Backdrop under the panel | Glass opacity | White text | #0B0D17 text |
|---|---|---|---|
| #0B0D17 (near black) | 0.12 / 0.30 / 0.50 | 14.29 / 7.33 / 3.63 | 1.36 / 2.64 / 5.33 |
| #6D4FB3 (purple) | 0.12 / 0.30 / 0.50 | 4.72 / 3.23 / 2.21 | 4.11 / 6.00 / 8.78 |
| #FF6B6B (coral) | 0.12 / 0.30 / 0.50 | 2.48 / 2.07 / 1.68 | 7.82 / 9.34 / 11.56 |
| #FFD166 (yellow) | 0.12 / 0.30 / 0.50 | 1.38 / 1.29 / 1.20 | 14.06 / 14.97 / 16.08 |
Body text needs 4.5:1 (SC 1.4.3). Two things stand out. Raising the opacity of white glass makes white text worse, not better — a common piece of advice (including an earlier version of this guide) gets it backwards; it only helps dark text. And no single opacity works over a backdrop that runs from dark to bright: white text passes over the dark area and fails over every other color in the table. Check contrast against the brightest and darkest colors that can sit under the panel, or give text panels a darker tint (a black layer at 0.4–0.6) when the text is white.
Accessibility Checklist
Respect the user's setting for reduced transparency: @media (prefers-reduced-transparency: reduce) lets you swap glass for an opaque surface. Chromium supports it from version 118; Safari and Firefox do not yet (MDN compatibility data, checked October 13, 2026), so treat it as an extra, not as your only fallback. Also test with Windows High Contrast / forced colors, where box-shadows are removed: a neumorphic control with no border simply disappears.
When to Use Each
Glass suits overlays where seeing through adds context — a sheet over a map, a navigation bar over a photo — provided the text on it is checked against the backdrop's extremes. Neumorphism suits small, self-contained controls (a media player, a calculator keypad) if every control also carries a 3:1 border or icon. For forms, dashboards and anything users must scan quickly, a flat surface with clear borders is still the safer default.
Performance Notes
backdrop-filter has to read and blur the pixels behind the element on every frame in which that backdrop changes, so a blurred bar fixed over a scrolling page is repainted continuously while you scroll. Keep the blur radius moderate, avoid stacking several blurred layers, and check a scroll recording in the Performance panel on a mid-range phone before shipping.
Experiment with blur, opacity, and borders visually.
⚡ Open Glassmorphism Generator- [1]W3C WCAG 2.2: Success Criterion 1.4.11 Non-text Contrast (Understanding document) ↗
- [2]W3C WCAG 2.2: Success Criterion 1.4.3 Contrast (Minimum) ↗
- [3]W3C WCAG 2.2: definition of relative luminance and contrast ratio ↗
- [4]MDN Web Docs: backdrop-filter (compatibility checked Oct 13, 2026) ↗
- [5]MDN Web Docs: prefers-reduced-transparency (Chrome/Edge 118+, not Safari or Firefox by default) ↗
- [6]W3C CSS Color Adjustment Module Level 1: properties affected by forced colors mode (box-shadow) ↗