Skip to content
OddsockLocal
Local
Base color#427f9c
Corner radius (px)8
Shadow offset (px)6
Surfaceflat
Base color#427f9c
Corner radius (px)8
Shadow offset (px)6
Surfaceflat
ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Set the base to the same color as the page behind the control.
  2. Choose flat, concave, convex, or pressed.
  3. Set the radius and the shadow offset.
  4. Copy the rule and put real text on it, then check that the letters clear the fill.

What is Soft UI CSS?

Soft UI only works when the element and the page are the same color, because the trick is two shadows: a light one up-left and a dark one down-right, both tinted from the base. The opening color #427f9c with an 8px radius and a 6px offset writes .soft with box-shadow 6px 6px 12px #2b5365, -6px -6px 12px #84acbf. Those two grays are the base mixed toward black and toward white. On a white page the same rule looks like a dirty sticker.

Read more

Flat and pressed keep the solid base as the background. Concave and convex swap in a diagonal gradient so the surface itself looks dished or domed. Pressed inverts the shadows to inset, which reads as a control that has been pushed in. A large offset on a small element makes the halo bigger than the control. Keep the offset well under the padding.

Contrast of any label is your problem. The snippet sets no text color, and a shadow is not a substitute for a difference between the letters and the fill.

Use cases

  • A settings panel on a matching colored page tries a flat soft card.
  • A toggle track uses the pressed surface so it looks recessed.
  • A designer compares concave and convex on the same swatch.
  • A prototype discovers the effect dies on a white body and changes the page color.
  • A design critique shows the light and dark shadows as a pair derived from one paint.

A flat teal surface

Base #427f9c, radius 8, offset 6, surface flat.

.soft { background: #427f9c; border-radius: 8px; box-shadow: 6px 6px 12px #2b5365, -6px -6px 12px #84acbf; }

Why use Oddsock

Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.

Related tools

Using this tool

The page behind is a different color from the base. Match them. The light and dark shadows are mixes of that base, so they only blend into the same paint.