Preview brand Custom

Shape and elevation

Rounded but not soft. One border weight, two shadows, and a clear order for what sits on top of what.

Corner radius

xs
sm
md
card
pill
round
xs
sm
md
card
pill
round
TokenValueUse
4px
8pxInputs, small controls, code
10pxPanels inside cards
14pxCards, callouts, images
999pxButtons, chips, the brand switch
50%Avatars, dots, the ring

Buttons are pills and cards are 14 px. The contrast between the two shapes helps people tell "something I can press" from "something I can read".

Elevation

There are two shadows. shadow.raised is the everyday one: faint in light mode and deeper in dark mode, where a subtle shadow would disappear. shadow.glow adds a soft halo in the brand's action colour; it is kept for the one thing on a page that should stand out from the rest, such as the product mockup at the top of a case study. Use it once per page at most. Cards also carry a 1 px border so they still read when no shadow can be seen (in print, in high-contrast modes).

A card: surface.raised, border.subtle, shadow.raised, radius.card.
The same card with shadow.glow: the one thing that should stand out.
A card: surface.raised, border.subtle, shadow.raised, radius.card.
The same card with shadow.glow: the one thing that should stand out.
TokenLightDarkUse
0 1px 2px rgba(21,34,56,0.06), 0 8px 24px rgba(21,34,56,0.06)0 1px 2px rgba(0,0,0,0.3), 0 8px 28px rgba(0,0,0,0.35) Two-layer CSS shadow, stored as a string (the build passes it through as-is)
0 1px 2px rgba(21,34,56,0.06), 0 0 0 1px color-mix(in srgb, var(--somnia-color-action-primary) 14%, transparent), 0 14px 44px color-mix(in srgb, var(--somnia-color-action-primary) 16%, transparent)0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px color-mix(in srgb, var(--somnia-color-action-primary) 26%, transparent), 0 12px 48px color-mix(in srgb, var(--somnia-color-action-primary) 20%, transparent) A soft glow in the brand accent that lifts one feature (the case study mockup) above the page. Use sparingly.

Layers and opacity

TokenValue
1
40
50
60
100
0.7
0.85
0.6

Never invent a z-index. If something needs to sit between two layers, add a token and say why.