Skip to content
UniKit

Neumorphism CSS generator

Pick a base colour, raised or inset, shadow distance and blur, intensity, radius and size to preview a neumorphic card; the light and dark shades are derived from the base colour and the full CSS is ready to copy.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Live preview

The preview backdrop is the base colour itself — neumorphism only works when object and background share one colour

Neumorphic card
Shape
8px
16px
20px
Size
220px
120px
Colours
40
Light shade#E6EAF0
Dark shade#B3B7BD

Light = base mixed towards white, dark = base mixed towards black, ratio = intensity ÷ 200.

Code

CSS
.neu-card {
  width: 220px;
  height: 120px;
  background: #E0E5EC;
  border-radius: 20px;
  box-shadow: 8px 8px 16px #B3B7BD, -8px -8px 16px #E6EAF0;
}

box-shadow only creates light and shadow, it does not raise text contrast: keep body copy dark instead of using pale grey text on a neumorphic card.

What this tool does

  • Build a neumorphic card or button: pick the base colour, tune the shadow distance, blur and shade intensity, flip between raised and inset, then copy the complete CSS.
  • Keep the palette consistent: the light and dark shades are derived from the base colour (mixed towards white and black), so you never have to guess values like #bec3c9, and changing the base updates both.
  • Debug "why is my neumorphism flat": the preview backdrop is the base colour — if the object and its container differ, the two shadows get swallowed by the background contrast. Make them the same colour first.
  • Build a pressed state: switch the direction to inset and the same values become two inset box-shadows, ready for a button :active rule.

Example

Input

Defaults: base #E0E5EC, raised, distance 8px, blur 16px, intensity 40, radius 20px, 220 × 120

Output

.neu-card {
  width: 220px;
  height: 120px;
  background: #E0E5EC;
  border-radius: 20px;
  box-shadow: 8px 8px 16px #B3B7BD, -8px -8px 16px #E6EAF0;
}

The light #E6EAF0 and dark #B3B7BD shades are pure derivation: mixing ratio = intensity ÷ 200 (40 → 0.2), light = base mixed 20% towards #FFFFFF, dark = base mixed 20% towards #000000.

Frequently asked questions

How does neumorphism affect accessibility and contrast?

This is its biggest weakness: the object and the background are deliberately the same colour, so elements have very little contrast and rely on shadows to be told apart. Shadows do not count towards WCAG contrast, so controls that are only distinguished by a shadow can be invisible to low-vision users or in bright light. Keep body copy and icons dark (at least 4.5:1 against the base), add a border or icon to essential controls, and never make shadows the only affordance.

Why does the effect look flat on my page?

Neumorphism requires the element and its container to share one background colour. If the card uses #E0E5EC while the page is white, the two shadows are overwhelmed by the colour difference — set the surrounding background to the base colour too, exactly like the preview backdrop does.

How are the light and dark shades computed?

The mixing ratio is intensity ÷ 200. The light shade mixes the base towards #FFFFFF by that ratio and the dark shade mixes it towards #000000 by the same ratio. At intensity 0 both equal the base (no depth at all); at 100 each is a 50% mix, which is already a strong contrast. Every channel is rounded to an integer.

What is the difference between raised and inset box-shadow?

Raised uses two normal shadows: a bottom-right offset in the dark shade and a top-left offset in the light shade, so the object appears to lift off the base. Inset keeps the same offsets and colours but prefixes both with inset, which flips the light and makes the shape look pressed in. Because only the keyword changes, the two make natural :hover / :active pairs.

How should distance and blur be paired?

A good rule of thumb is blur ≈ distance × 2 (the default is 8px / 16px). Large distance with small blur gives a hard edge; a blur much larger than the distance smears the shadow into a haze with no direction. Distances beyond a quarter of the element size usually look fake.

Can I design a whole site in neumorphism?

Not really. It suits a few decorative cards or buttons: contrast is low, readability suffers and it cannot express hierarchy because everything sits on one plane. Lists, tables and forms need conventional borders and spacing.

Keywords:neumorphismbox-shadowsoft ui

Related tools