Documentation

Radius & Elevation

VitNode's corner radius scale, concentric corners, soft shadow scale and surface layers that show depth in light and dark mode.

One variable sets every corner, six soft shadows set every height, and in dark mode the surfaces themselves get lighter as they rise. Depth without the drama.

Radius scale

--radius: 0.75rem
  • rounded-sm×0.6 ·
  • rounded-md×0.8 ·
  • rounded-lg×1 ·
  • rounded-xl×1.4 ·
  • rounded-2xl×1.8 ·
  • rounded-3xl×2.2 ·
  • rounded-4xl×2.6 ·

Every rounded-* class is a multiple of --radius (0.75rem). Drag the slider to feel it: change the one variable in src/styles.css and the whole UI gets rounder or sharper.

:root {
  --radius: 0.75rem;
}

Corners nest

padding: 12px
Do
inner = 0 − 12 = 0px
Don't
inner = outer = 0px

Inner radius = outer radius − padding. Copy the outer radius onto the inner box and the corners bulge like a badly packed suitcase. That's why menus are rounded-lg with p-1 and their items are rounded-sm.

<div className="rounded-lg p-1">
  <button className="rounded-sm px-2 py-1.5">Edit</button>
</div>

Shadow scale

  • shadow-2xsFlat rows that need a hint
  • shadow-xsButtons, inputs, cards
  • shadow-smSlider thumbs, active tabs
  • shadow-mdNavigation menus
  • shadow-lgPopovers, menus, sheets
  • shadow-xlDialogs

Shadows are soft and low-alpha: they hint at height instead of shouting it. The higher something floats, the bigger its shadow. Flip to dark mode and they almost vanish. That's on purpose, see below.

Where things live

Surface
bg-cardL …
Radius
rounded-xl
Shadow
shadow-xs + ring

Each level has its own surface, radius and shadow. In light mode the shadow carries the depth. In dark mode shadows disappear, so each layer gets lighter instead: background → card → popover. Dialogs share one scrim from modal-scrim.ts, so every modal dims the page the same way.

LevelSurfaceRadiusShadow
Controlsbg-cardrounded-mdshadow-xs
Cardsbg-cardrounded-xlshadow-xs + ring-1
Menus and selectsbg-popoverrounded-lgshadow-lg + ring-1
Popoversbg-popoverrounded-xlshadow-lg + ring-1
Dialogsbg-popoverrounded-xlshadow-xl + scrim

Border or shadow?

Do
Inline content sits flat with a hairline border.
Don't
A big shadow on content that never moves.
Do
Floating layers get a shadow plus a faint ring.
Don't
A border-only menu melts into the page.

Content that stays in the page flow gets a hairline border. Anything that floats above it gets a shadow and a faint ring-1 ring-foreground/10, so it still has an edge in dark mode.