How Neumorphism Generator works
Neumorphism needs three colours that belong together: a surface, a slightly lighter highlight and a slightly darker shadow. This tool works out the last two from the first. Pick a surface such as #e0e5ec and, at the default 10% intensity, it returns a white highlight and a #c0cad8 shadow, then writes box-shadow: 12px 12px 24px #c0cad8, -12px -12px 24px #ffffff. Sliders set the corner radius, shadow distance, blur and intensity, and the Shape menu switches between flat, concave, convex and pressed. One point decides whether the effect works at all: the surface cannot be pure white, because there is no lighter colour left for the highlight.
Neumorphism colour chart: light and dark shadows for common surface colours
Derived colours the tool returns at the default 10% intensity. A highlight identical to the surface, or a shadow identical to it, means that side of the effect is missing.
| Surface colour | Light shadow | Dark shadow | Result |
|---|---|---|---|
| #ffffff (white) | #ffffff | #e6e6e6 | No highlight; reads as a plain drop shadow |
| #fafafa | #ffffff | #e0e0e0 | Highlight barely visible |
| #f5f5f5 | #ffffff | #dbdbdb | Faint highlight |
| #f0f0f3 | #ffffff | #d5d5dd | Subtle, highlight weaker than shadow |
| #ecf0f3 | #ffffff | #cdd7e0 | Works, slightly shadow-heavy |
| #e0e5ec | #ffffff | #c0cad8 | Balanced; the classic light soft UI |
| #e0e0e0 | #fafafa | #c7c7c7 | Balanced neutral grey |
| #dde1e7 | #fcfcfd | #c0c8d3 | Balanced |
| #cccccc | #e6e6e6 | #b3b3b3 | Balanced, lower key |
| #3b82f6 (blue) | #6da2f8 | #0b64f4 | Balanced coloured surface |
| #2d2d2d | #474747 | #141414 | Balanced dark soft UI |
| #1e1e2e | #32324d | #0a0a0f | Works, dark side nearly black |
| #121212 | #2b2b2b | #000000 | Shadow side clipped to black |
| #000000 (black) | #1a1a1a | #000000 | No dark shadow; highlight only |
Lowering Intensity helps near-white surfaces: at 5%, #ecf0f3 gives #fcfdfd and #dce4e9, and #e0e5ec gives #eff2f5 and #d0d7e2, so neither side is clipped.
How the two shadow colours are calculated
Light = surface with HSL lightness + intensity. Dark = surface with HSL lightness - intensity. Both are limited to the 0 to 100% range. box-shadow: [distance] [distance] [blur] dark, -[distance] -[distance] [blur] light.
Intensity is in percentage points of lightness, not a multiplier. Hue and saturation stay the same, so the shadows look like the same material in different light. #e0e5ec has a lightness of about 90%, so adding 10 reaches 100%, which is white, and subtracting 10 gives #c0cad8. Because lightness cannot go above 100% or below 0%, a surface closer to white than the intensity value loses its highlight, and one closer to black loses its shadow. A workable rule: keep the surface lightness at least as far from both ends as the intensity you choose. The intensity slider runs from 2 to 30. At 2 the default surface gives #e6eaef and #d9dfe8, which is almost invisible. At 30 it gives white and #8195b1, which is heavy and no longer soft.
Neumorphism CSS examples: card, button, dark mode and input well
The declarations the tool writes inside its .soft rule for the settings shown. Fields that are not mentioned stay at their defaults.
Default raised card
Surface colour #e0e5ec, Corner radius 26, Shadow distance 12, Shadow blur 24, Intensity 10, Shape Flat
background: #e0e5ec; border-radius: 26px; box-shadow: 12px 12px 24px #c0cad8, -12px -12px 24px #ffffff;
Pressed state of the same card
Same settings, Shape Pressed
background: #e0e5ec; border-radius: 26px; box-shadow: inset 12px 12px 24px #c0cad8, inset -12px -12px 24px #ffffff;
Swap between these two rules on :active, or for the on and off states of a toggle.
Convex button
Surface colour #e0e5ec, Shape Convex
background: linear-gradient(145deg, #ffffff, #c0cad8); border-radius: 26px; box-shadow: 12px 12px 24px #c0cad8, -12px -12px 24px #ffffff;
Concave gives the same shadows with the gradient reversed: linear-gradient(145deg, #c0cad8, #ffffff).
Small, subtle pill on an off-white page
Surface colour #f0f0f3, Corner radius 50, Shadow distance 6, Shadow blur 12, Intensity 6
background: #f0f0f3; border-radius: 50px; box-shadow: 6px 6px 12px #e0e0e6, -6px -6px 12px #ffffff;
Dark mode input well
Surface colour #2d2d2d, Corner radius 16, Shadow distance 8, Shadow blur 16, Intensity 8, Shape Pressed
background: #2d2d2d; border-radius: 16px; box-shadow: inset 8px 8px 16px #1a1a1a, inset -8px -8px 16px #424242;
White surface pushed to the maximum
Surface colour #ffffff, Intensity 30
background: #ffffff; border-radius: 26px; box-shadow: 12px 12px 24px #b3b3b3, -12px -12px 24px #ffffff;
Even at full intensity the second shadow is white on white. Raising intensity cannot rescue a pure white surface.
Fixing neumorphism on a white or very light background
If your design has to sit on a white page, there are three workable options.
Darken the page slightly. Moving from #ffffff to #e0e5ec or #e0e0e0 is a small visual change and gives the highlight somewhere to go. Most soft UI that looks white is really a pale grey or pale blue-grey.
Use a tinted panel. Keep the page white and place the neumorphic controls inside a section with an off-white background. Each element only has to match its immediate parent, not the whole page.
Accept a one-sided effect. On pure white you can keep the dark shadow alone and drop the second one. That is no longer true neumorphism, but a soft grey shadow on white is a clean, common look, and it is what the tool's white output amounts to.
The mirror-image problem applies in dark mode. On #000000 the dark shadow vanishes and only the highlight shows. A dark grey such as #2d2d2d leaves room on both sides.
Accessibility: the shadows cannot be the only cue
The edge of a neumorphic control is drawn only by its shadows, and those are deliberately close to the surface colour. For the default output, the dark shadow #c0cad8 against the #e0e5ec surface has a contrast ratio of about 1.3 to 1, and the white highlight about 1.27 to 1. WCAG 2.1 success criterion 1.4.11 asks for at least 3 to 1 for the visual information needed to identify a user interface component and its states.
In practice that means people with low vision, or anyone on a dim screen or in bright sunlight, may not see where a button begins. Keep the style, but add cues that do meet the threshold: a text label or icon with strong contrast against the surface, a visible focus outline, and a state change that involves more than the shadow flipping from raised to pressed, such as a colour or icon change.
What the generator fixes and what you edit by hand
- The light source is always top left: the dark shadow is offset down and right, the light shadow up and left. For another direction, change the signs of the offsets in the copied rule.
- Both shadows share one distance and one blur. Unequal highlight and shadow sizes need manual editing.
- There is no size control. The rule contains no width or height, so it applies to an element of any size.
- The concave and convex gradient is fixed at 145 degrees.
- The rule uses a placeholder .soft selector. Rename it to match your own class.
How to use it
- 1
Pick a Surface colour. Use the same colour for the page or panel behind the element.
- 2
Set Corner radius from 0 to 80 pixels.
- 3
Adjust Shadow distance and Shadow blur. A blur of about twice the distance, as in the default 12 and 24, gives the usual soft look.
- 4
Raise or lower Intensity to control how far the light and dark shades sit from the surface.
- 5
Choose a Shape: Flat, Concave, Convex or Pressed.
- 6
Check the Light, Surface and Dark swatches under Derived colours, then copy or download the CSS.