Something went wrong. Try again.
Browser extension: detect and subscribe to standard.site publications on ATProto substandard.blog
Something went wrong. Try again.
Design system #
The popup is one paper surface. Its tokens live at the top of
src/popup/popup.css; components use those tokens instead of one-off values.
Tokens #
- Palette:
--fg,--muted,--bg,--card,--border,--red,--gold,--good,--warn,--bad, and their paired text colors.--inkis the sticker outline and stays visible on both papers. - Focus:
--focusand--focus-ringare deliberately not the brand red, so a focus ring never reads as an error. - Space:
--space-1through--space-6(4px base). - Radius:
--radius-1through--radius-3. - Type:
--text-xs,--text-sm,--text-base,--text-md,--line-tight,--line. - Motion:
--dur-1,--dur-2,--ease. The reduced-motion media query turns both animations and transitions off. --tapis the minimum hit target for an icon or text control.
Dark mode is chosen by data-theme on <html>. public/theme-init.js reads
the stored choice synchronously before the stylesheet, so the first paint is
already correct; src/popup/theme.ts owns the control and follows the OS while
the choice is System. The first-run welcome page includes the same script and
uses the same key; its palette is a separate copy because it is a larger
surface, but it follows the same theme choice.
Components #
- Badges (
.badge): one identity shape for accounts, publications, posts, authors and labelers. The kind changes the media shape, never the color; color is reserved for severity. - Buttons (
.btn,.btn.primary,.btn.sm,.icon-btn,.link-btn): the minimum height is 32px (26px small, 24px for icon and text links). - Menus (
.menu,.item,.menu-row): wired throughsrc/popup/menu.ts. Arrow keys, Home/End, Escape and Tab are handled; opening focuses the first item and Escape returns focus to the trigger. - Disclosures (
src/popup/disclosure.ts): a trigger and a panel, witharia-expandedandaria-controls. Clicking inside never closes a form. - Tabs (
#tabs,.tab): the popup's primary navigation. Threerole="tab"buttons select onerole="tabpanel"; arrow keys, Home and End move selection and focus, and the inactive panels are hidden. - Status pills (
.pill): severity is both a tone and a shape, so it survives without color vision.
Accessibility rules #
- Every interactive element gets the global
:focus-visiblering. Do not setoutline: nonewithout an equivalent replacement. - New menus use
wireMenu; new panels usewireDisclosureor are a card whoserenderowns its state. - Status text goes in a live region:
#statusand#action-notearerole="status"; errors userole="alert". - Keyboard focus never moves into a hidden panel. Opening a menu or disclosure moves focus; closing returns it. Tabs keep focus on the selected tab while arrow keys move through the tab list.
- Color is not the only channel for a state. Badges use shape, pills use an icon, and focus uses an outline.
prefers-reduced-motion,prefers-contrast: moreandforced-colorseach have a rule. Keep them working when adding color or motion.- Forms have a label (visually hidden when the design has no room), and a submit button inside the form.
Adding a surface #
- Use the existing tokens; add a token only when a value repeats.
- Prefer
.badgefor an identity,.btnfor an action,.pillfor a state, and a tab when the surface is a new top-level view. - If it opens, wire
wireMenuorwireDisclosureand give the triggeraria-expanded/aria-controlsthrough it. - Add the surface to the popup's card registry when it fetches or owns a
section; see
src/popup/cards/card.ts. - Check light, dark, keyboard-only, reduced motion and forced colors.