Design
Accessibility
What the components guarantee, and what remains the application's part.
#What components guarantee
- Native semantics. A button is a
button, a navigation is a link, a form submits. Tabs, filters and pagers are links with a URL, so they work with the keyboard, with a screen reader and without JavaScript. - Names and associations.
Fieldconnects label, help and error to its control. AnIconButtonrequires a label. A table keeps its caption, header cells and row headers. - Focus. Every interactive element has a visible focus indicator from
--faifo-focus-borderand--faifo-focus-ring. Dialogs trap focus and return it to the control that opened them; aPeekand aDockare non-modal and take no focus. - State in more than colour. A tone always comes with a label or an icon. A selected row has
aria-selected, a current itemaria-current, an invalid controlaria-invalid. - Contrast. Semantic text colours are chosen for AA contrast on the surfaces they belong to, in both themes. Tests hold the cases that regressed before, such as the danger badge on dark table and record surfaces.
- Motion. Transitions are short, and their durations collapse under
prefers-reduced-motion: reduce.
#What the application provides
- Translated labels for every control, including the ones only assistive technology reads.
- A sensible heading outline:
Textseparates the visual role from the element so the outline can be correct. - Errors written as a next step, returned from the server and passed to the field that caused them.
#Forced colours
Under forced-colors: active (Windows contrast themes) the browser drops box-shadow and
background images and replaces author colours with the user's palette. The design system
draws many edges, focus rings and states with shadows and tinted fills, so
foundations/forced-colors.css, imported last, redraws them inside that media query with
outlines and borders in system colours:
| What | Forced colours |
|---|---|
| Edge of a button, link button, menu trigger, text/select/textarea field | 1px outline, ButtonText |
| Edge of a date field or relation picker (drawn on its box; the input inside it has none) | 1px outline, ButtonText |
| Edge of a modal sheet, dialog, popover, menu panel, FaifoGrid popup | 1px outline, CanvasText |
| Keyboard focus | 2px outline, Highlight |
| Keyboard focus on a control that already shows a state (pressed button, active tab or navigation item, selected or current ResourceList item, invalid field, date field or switch) | 4px double outline, Highlight, outside the box |
| Pressed button, active tab, active menu item, selected FaifoTable row, ResourceList selected or current item, active navigation item, selected FaifoGrid cell | inset outline, Highlight |
| Menu item under the pointer | 1px dashed inset outline, Highlight (keyboard focus keeps the 2px ring) |
| FaifoTable current row, ResourceList current item | 4px leading border, Highlight (on the whole row when FaifoTable stacks rows on a narrow screen) |
| Disabled (a disabled menu item greys its description, shortcut and check mark too) | GrayText |
| Checked menu item | check mark drawn in the item's own text colour; an unchecked item keeps an empty slot |
| Invalid field, date field box, relation picker or FaifoGrid cell | 3px double outline, CanvasText |
| Edited FaifoGrid cell | 1px dashed inset outline and the corner mark, CanvasText |
| Edited and invalid FaifoGrid cell | the invalid outline; the corner mark still shows the edit |
| Switch | Highlight track with a HighlightText thumb when on; GrayText when disabled; 3px double CanvasText outline on the track when invalid |
Checkbox and radio are native controls and follow the palette themselves; a disabled option's
label turns GrayText. The test compares screenshots of checked against unchecked and disabled
against enabled, because computed style cannot show the native mark. An edited or invalid
FaifoGrid cell differs from a plain cell by its outline, not by colour alone. Nothing in the sheet
applies outside the media query: light and dark rendering is unchanged. A component that adds
a shadow edge, a shadow focus ring or a fill-only state adds its forced-colours rule to that
sheet in the same change.
To look at it, open a catalogue page in Chrome or Edge, then DevTools → Rendering → Emulate
CSS media feature forced-colors → active. Test: test/browser/forced-colors.test.tsx
(browser lane) serves the real catalogue, emulates the media feature, reads outline, border and
colour of each control, state and focus-on-state combination, and checks on every page it visits
that normal light and dark rendering matches the catalogue with the sheet disabled.
#Popups
Every popup built on <details> behaves like the action menu: a click outside it
closes it, and Escape closes the open one and returns focus to its summary. This
covers Menu (data-ui="menu"), the period choice of TimeframeFilter
(data-ui="timeframe-menu") and list view settings (data-ui="view-settings").
The runtime lists the non-menu popups in DISMISSIBLE_POPUPS; a new popup component
adds its hook there instead of wiring its own document listener.
The outside click is heard on the document, so an island that follows a link in place
calls preventDefault() only: the shell's fragment navigation already leaves a
prevented click alone, and stopPropagation() would keep an open menu or filter
popover open after the click.