Neumorphism CSS Design Complete Guide

Master the soft UI technique with dual shadows, color requirements, and accessibility considerations for modern interfaces.

2 shadows required Same hue palette WCAG contrast issues

Neumorphism emerged in 2020 as a design trend blending skeuomorphism and flat design. It creates the illusion of elements extruded from or pressed into the background using carefully placed shadows.

The technique relies on a monochromatic palette and two opposing shadows — one light, one dark — applied to the same element. Understanding the math behind it unlocks consistent, professional results.

What is neumorphism

Neumorphism (or "new skeuomorphism") creates a soft, extruded appearance by placing a light shadow on the top-left and a dark shadow on the bottom-right of an element. The background and element share the same base color, creating a seamless blend. Unlike flat design, neumorphism implies physical depth and tactile texture without photorealistic detail.

Free Tool Neumorphism Generator Create soft UI extrusion effects with dual box shadows

The dual shadow technique

The core of neumorphism is the dual box-shadow: one light shadow offset toward the light source (top-left), and one dark shadow offset away from it (bottom-right). The shadow color is derived by lightening and darkening the background hue by 10–15%. Both shadows use a blur radius of 20–30px and zero spread for soft edges.

Color requirements

Neumorphism only works within a narrow color range. The background must be a mid-tone — neither too light nor too dark — and the light and dark shadows must share the same hue. Here is the CSS pattern:

.card {
  background: #e0e5ec;
  box-shadow:
    8px 8px 20px #b8bec7,
    -8px -8px 20px #ffffff;
  border-radius: 12px;
}
Free Tool Glassmorphism Generator Create frosted glass UI effects with CSS backdrop-filter

Convex vs concave

Convex elements (raised) use outward shadows: light top-left, dark bottom-right. Concave elements (pressed) use inward shadows with the `inset` keyword, reversing the illusion. Toggle between states to indicate pressed buttons or active inputs. Combining outward and inset shadows on the same element can simulate a toggle switch.

Accessibility problems

Neumorphism's low contrast between the element and background frequently fails WCAG 2.1 AA requirements (minimum 3:1 for UI components). Text placed on neumorphic surfaces often falls below 4.5:1. Solutions: increase shadow opacity, use a border for focus states, or reserve neumorphism for decorative elements only. Always test with a contrast checker.

When to use neumorphism

Neumorphism works best for dashboards, clocks, audio players, and kiosks where brand aesthetics outweigh strict accessibility needs. Avoid it for primary navigation and text-heavy interfaces. Hybrid approaches — neumorphic cards with flat content inside — balance visual interest and usability.

Free Tool Box Shadow Generator Create layered CSS box shadows with live preview

FAQ

What is neumorphism in CSS? +
Neumorphism is a design style that uses dual box-shadows — one light and one dark — on elements sharing the same color as the background, creating a soft extruded or pressed appearance.
How do I create the dual shadow in CSS? +
Apply box-shadow with two values: a light shadow offset top-left (negative x, negative y) and a dark shadow offset bottom-right (positive x, positive y). Both use the same blur radius, typically 15–30px.
What colors work for neumorphism? +
Mid-tone grays and desaturated pastels work best. The shadow colors must share the same hue as the background, lightened and darkened by 10–15% respectively.
What is the difference between convex and concave neumorphism? +
Convex elements appear raised with outward shadows. Concave elements appear pressed in using the CSS `inset` keyword inside box-shadow, which reverses the light and dark shadow positions.
Does neumorphism pass WCAG accessibility standards? +
Often not. The low contrast between element and background frequently fails the 3:1 minimum for UI components. Use borders, increased shadow opacity, or limit neumorphism to decorative elements.
Can I combine neumorphism with other design styles? +
Yes. Hybrid approaches use neumorphic containers with flat or material design content inside, balancing visual texture with contrast and readability.
Which tools help generate neumorphic CSS? +
The PixCode Neumorphism Generator lets you adjust background color, shadow distance, blur, and intensity with a live preview and instant CSS output.