Accessibility
A person should be able to do everything in Werklist with a keyboard or a screen reader, and read it at twice the text size. These rules set the minimum a screen meets before it ships.
Contrast
4.5 to 1
Text needs 4.5 to 1 against what is behind it, in both themes. A large heading gets no lower floor.
--text-muted on --surface-control3.5 to 1
The word on a status chip is the one exception. It needs 3.5 to 1 on its tint, so the ink can keep the hue of its chip.
--warning-ink on its tint over --surface-control--brand-ink on its tint over --surface-control3 to 1
Icons that carry meaning, the focus ring and chart marks need 3 to 1. People recognize a shape at a lower contrast than they need to read a letter.
--focus-ring on --surface-controlCheck both themes. White text on --brand-blue reads 5.44 to 1 in light and 3.67 to 1 in dark.
More than color
Pair color with a word, an icon or a shape: a status has its word, an error its message and icon, and a chart series its label.
Underline links inside running text. Against body text, blue link text reaches only 2.36 to 1 in light and 2.72 to 1 in dark, too little to find by color.
Read the writing guide before you name a status.
Focus
A control that receives keyboard focus shows the ring. It appears on :focus-visible, so a mouse click does not draw it, and it is not removed unless something as visible replaces it. A control that takes focus is never hidden under the sticky header.
Draw the ring as an outline, not a shadow: in Windows high contrast the browser repaints outlines in the system color and drops shadows. The gap keeps the ring off the control's own fill, where a blue ring on a blue button would disappear.
- Color
- light #1863dc, dark #7fb3ff
- --focus-ring
- Width
- 2 px
- --focus-ring-width
- Gap
- 2 px
- --focus-ring-offset
- Ring on a panel
- light 5.44 to 1, dark 7.87 to 1
- --focus-ring on --surface-1
Keyboard
Everything a pointer can do, a keyboard can do, and a swipe always has a button that does the same. Focus moves in reading order, left to right and top to bottom. When a menu or a dialog closes, focus returns to the control that opened it.
The first stop on a page is a link that skips to the main content.
- Tab, Shift+Tab
- Next or previous control
- Enter
- Follow a link, press a button, submit a form
- Space
- Press a button, check a checkbox, turn a switch on or off
- Arrow keys
- Move inside a group, such as tabs or a menu
- Home, End
- First or last item of a menu or a list
- Escape
- Close the front menu, popover or dialog and return focus
Target size
A target is the area that answers a click or a tap, and it can be larger than what is drawn.
- Touch
- 44 by 44 px
- @media (pointer: coarse)
- Mouse and trackpad
- 24 by 24 px
- @media (pointer: fine)
Text size and zoom
Body text is 16 px and the smallest text, a caption, is 13 px. On a touch screen any text a person edits is at least 16 px, or iOS zooms the page when the field receives focus.
Do not turn zoom off with maximum-scale or user-scalable=no. At 320 px wide, the width of a 1280 px window at 400 percent zoom, the page reflows into one column with no sideways scrolling. Text enlarged to 200 percent does not clip or overlap.
Names and structure
A page has one h1, and its headings descend in order. The header, the navigation, the main content and the footer are landmarks a screen reader can jump between.
Each control has a name a screen reader announces. A count on a control joins that name, as in “Notifications, 3 unread”, and the number itself is hidden from the reader.
When content changes and focus stays put, such as a saved confirmation, announce it in a polite live region. An error that stops the task uses an alert.
Motion and time
When a person asks their system for reduced motion, slides and scales become instant and fades stay.
Nothing a person has to read or act on disappears on a timer. A message with an action stays until the person dismisses it.
Permitted and not permitted
Permitted
Replace the browser's outline with --focus-ring.
Label each field with visible text above it.
Show hover actions on focus as well.
Not permitted
Set outline: none with nothing in its place.
A keyboard user loses their place.
Use the placeholder as the label.
It disappears as soon as the person types.
Reveal an action on hover only.
A keyboard or a touch screen cannot reach it.