Presets
Edge contrast 1.40:1. Below 3:1, so some users may not see the shape. Add a border or icon.
Text contrast 6.09:1. Passes WCAG AA for body text.
.neumorphic {
border-radius: 24px;
background: #e4e4e7;
box-shadow: 12px 12px 24px #c2c2c4, -12px -12px 24px #ffffff;
}
/* Page or parent background */
body {
background: #e4e4e7;
}Shape
How to use
Pick the background
Choose a color with the picker, type a hex value such as #e4e4e7 or #ddd, or start from a preset. The element and the page need the same color, so the preview uses it for both.
Shape the shadows
Pick Flat, Concave, Convex or Pressed and a Light source corner, then set Radius, Distance, Blur and Intensity. Watch the edge and text contrast notes under the preview.
Copy the code
Copy the CSS, Tailwind classes or SCSS variables and apply them to an element on a parent with the same background color. Copy share link saves the settings.
Why CSS Neumorphism Generator
- Light and dark shadows calculated from one background color.
- Flat, concave, convex and pressed shapes with light from any corner.
- Separate blur, distance, intensity and radius, plus seven presets.
- Built-in edge and text contrast check, with CSS, Tailwind and SCSS output.
How the light source changes the shadow pair
Both shadows use the same distance and, by default, a blur of twice the distance. Only their direction changes with the light source. With the default distance of 12px, the tool writes these offsets.
The dark color is the background darkened by the Intensity percentage, and the light color is the background brightened by the same amount, capped at pure white. With the Pressed shape, both shadows get the inset keyword and keep the same offsets, so the pressed state lines up with the raised one. Longer distances need a larger radius and more empty space around the element, or the shadows overlap nearby elements or get clipped by a parent with overflow: hidden.
| Light source | Dark shadow offset | Light shadow offset |
|---|---|---|
| Top left | 12px 12px | -12px -12px |
| Top right | -12px 12px | 12px -12px |
| Bottom right | -12px -12px | 12px 12px |
| Bottom left | 12px -12px | -12px 12px |