Component specWhat
badge.js drawsThe badge
A small pill that sits inside someone else's blog. It has a light and a dark set of colours and picks one from the page it is on, and has one accent colour you can set. Every state below is the same component. This page draws it in the site's own font; badge.js uses the system font.
Try it
Tab to focus · Space/Enter toggles · ← → skip 10 s
States
Each panel: desktop (40 px) then touch (44 px, on touch screens; the voice label is hidden below a 480 px viewport).
Anatomy and measurements
Keyboard and ARIA
Design tokens
Defined as CSS variables in tokens.css for [data-theme="day"] and [data-theme="night"], with prefers-color-scheme as the default.
Type scale
Display
Newsreader 600 · 42–86 · lh .96Section
Newsreader 600 · 36–64 · lh 1Article body
Newsreader 400 · 19 · lh 1.6Interface
Geist 400–600 · 13–17LABEL · CODE
Geist Mono 400–600 · 10.5–13.5
Spacing
Radii
2 · blocks8 · terminal999 · pill50% · button