Command Palette

Search for a command to run...

Foundations

Web platform

The browser policy and the CSS and HTML rules every surface follows. They come from Google's modern web guidance; each rule names the guide it comes from.

Browser policy

Baseline widely available features are used freely. Newly available ones (popover, light-dark(), scrollbar-color, container style queries, scroll-driven animations, font-size-adjust) ship only as progressive enhancement, behind @supports or a feature check, with the page complete without them. No polyfill loads unconditionally. Before building a UI pattern, search the guidance: npx -y modern-web-guidance@latest search "<capability>".

CSS

Cascade
Layers, not specificity games: @layer base for element defaults, utilities above it. :where() for overridable defaults, :not() to exclude rather than undo, @scope when the nearest theme should win. No resets on *. (css)
Tokens
No literal colour, size or duration in a component. Name tiers only as deep as the use needs: palette, then semantic (--danger), then component. (css)
Dark mode
Class-driven tokens with color-scheme set beside them. The theme setting has three states (System, Light, Dark), stores only an explicit choice, and a script in <head> applies it before the first paint. (dark-mode, dark-mode-toggle)
Layout
Components respond to their container (@container), pages to the main column's container. dvh, not vh, for full-height panes; aspect-ratio or width and height on every image and chart. (responsive-design)
Type
Sizes in rem; fluid sizes are clamp() with the maximum at most 2.5 times the minimum; unitless line-height; text-wrap: balance on headings, pretty on paragraphs; no fixed height on anything that holds text. (typography)
Font fallbacks
font-size-adjust: from-font where each family is set, so a fallback keeps Geist's x-height and nothing reflows when the font arrives. (visually-stable-font-fallbacks)

Interaction

Focus
A solid 2px --ring outline on :focus-visible with a 2px offset, 3:1 against the page. Never outline: none without it, never a translucent ring, never a box-shadow alone. Items in a scrolling list draw it inset. (accessibility)
Targets
At least 24 by 24 CSS px through min-block-size or padding, never a fixed height; larger under pointer: coarse. (accessibility)
Tooltips
Open on hover and focus, close on Escape, stay open while the pointer crosses onto them, never move focus. A hint that repeats the trigger's label adds no ARIA. (interest-triggered-tooltips)
Native first
<button> for actions, <a href> for navigation, <dialog>, popover and <details> before a scripted overlay, accent-color before redrawing a checkbox. Never user-select: none on content. (natural-interactions, browser-ui-theming)
Noise
No modal the reader did not ask for. A blocking dialog only for a consequential action (delete, pay, ship); secondary detail behind a popover, <details> or a link. (content-first-noise-reduction)

Do

A solid orchid outline that shows on keyboard focus only.

Don't

outline-none with a half-transparent glow as the only focus sign.

Tables and scrolling

Tables
A real <table> with <th scope>, a sticky header, numbers right-aligned in tabular figures. A narrow container stacks rows with labels; a scrolling wrapper is a labelled region with tabindex=0. Long cells truncate and reveal on hover and focus, never through title. (responsive-table, single-line-overflow)
Scrollbars
Default width: thin is too small to grab. The thumb is --scrollbar-thumb, 3:1 on every surface. A row of chips or tabs fades at the edge only while there is more to scroll. (browser-ui-theming, scrollability-affordance-hints)

Motion and forced colours

Motion
Animate transform and opacity. Reduced motion is decided per animation, next to it: spatial motion goes inside prefers-reduced-motion: no-preference, a spinner slows down under reduce, colour transitions stay. Never a global animation-duration: 0.01ms. (motion)
Forced colours
The racing cues are gradients and vanish in forced colours, so each sits beside a word or icon that carries the same meaning. Edges fall back to CanvasText, the ring to Highlight. (color)