Skip to content

LAY-003b Keep all text and functions intact when people widen the text spacing

Level
Rule
Verdict
Requirement
Area
Layout
Status
proposed, version 1.0.0

Rule

When a person sets line height to 1.5 times the font size, space after paragraphs to 2 times, letter spacing to 0.12 times and word spacing to 0.16 times, no text is cut off, hidden or laid over other content, and every function still works. The page need not use these values itself.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: A shift card that gives way

Line height 1.5, letters 0.12 em, words 0.16 em, paragraphs 2 em.

Saturday morning, food bank

  • Needs 2 more volunteers
  • Front desk
  • 9:00 to 12:00

Sort and pack the donated food, greet families at the door and help carry boxes to the cars. Closed-toe shoes are needed, and the kitchen team provides tea at ten.

Switch on Apply text spacing. The badges grow with their words, and one that no longer fits moves to the next line. The card gets taller and the button stays below the text. The description is clamped to three lines because its title is a link to the full shift.

Don't: Fixed heights that cut text off

Line height 1.5, letters 0.12 em, words 0.16 em, paragraphs 2 em.

Morning shift, front desk

Sunday set-up

Set out the chairs and tables. Closed-toe shoes are needed.

The chip has a fixed height and overflow-hidden, and the description a fixed maximum height. At normal spacing all of it shows. Switch on Apply text spacing and the second line of the chip and the part about closed-toe shoes are hidden, with nothing to open.

Do: Sidebar items that wrap

Line height 1.5, letters 0.12 em, words 0.16 em, paragraphs 2 em.

Each item has a minimum height and no truncation. With Apply text spacing on, Community kitchen volunteers wraps onto a second line and the whole name is still there.

Don't: Sidebar items that truncate

Line height 1.5, letters 0.12 em, words 0.16 em, paragraphs 2 em.

Each item has a fixed height and truncates its label. At normal spacing the names fit. With Apply text spacing on, Community kitchen volunteers ends in an ellipsis and there is no other way to read the rest.

Don't: Tabs with a fixed width

Line height 1.5, letters 0.12 em, words 0.16 em, paragraphs 2 em.

Each tab is a fixed width and truncates its label. At normal spacing all three read in full. With Apply text spacing on, Swap requests is cut to part of a word.

Why

Some people with low vision or dyslexia read much better when lines, words and letters sit further apart, and they set this with a browser extension, a bookmarklet or a style sheet of their own. A layout that was measured to the pixel for the default spacing then cuts off the last line of a card or turns a tab label into half a word. WCAG 2.2, 1.4.12 Text Spacing requires that nothing is lost when those four values are applied and no other style is changed. The values are the floor of the test; people may choose more. The criterion does not ask the page to use them by default or to offer a control for them; it asks the page to survive them. The Working Group documents the usual break, text in a box that cannot grow, clipped or spilling over its neighbour, as a failure (F104). The same boxes often break when text grows in size, which is LAY-003a.

Do

  • In a volunteer rota app, the badge "Needs 2 more volunteers" on a shift card has px-2 py-0.5 and no height of its own, so a taller line or wider word spacing makes the badge bigger rather than cutting it. A row of such badges uses flex flex-wrap gap-2, so a badge that no longer fits moves to the next line.
  • Let a shift's description set the card's height: min-h-* instead of h-*, vertical padding instead of a fixed height, and grid rows that size to their content.
  • Clamp a long description with line-clamp-3 only where the full text is one step away: the card's title Saturday morning, food bank is a link to the shift page, which shows the description in full.
  • Let sidebar items, tabs, segmented controls and nav pills grow with their label. These often have a fixed height together with overflow-hidden or truncate on the label. Test the ones you use rather than assuming they pass.
  • Let a sidebar item such as Community kitchen volunteers wrap onto a second line rather than truncate it. If it must stay on one line, make the full name one step away, such as on the page the item opens. A tooltip that also opens on focus is enough only when the visible part, such as Community kitchen…, still tells the item apart from the others (TXT-002b).
  • A button with a fixed height and a one-line label, such as Justified's Button with h-10, usually still fits the taller line. Check any button whose label could wrap under the wider spacing, for example in a narrow column.
  • Test with all four values at once and nothing else changed: line-height: 1.5, letter-spacing: 0.12em and word-spacing: 0.16em on every element, and margin-bottom: 2em on paragraphs. Open menus, dialogs and toasts during the test.

Don't

  • Give the chip "Morning shift, front desk" h-6 overflow-hidden, so the wider spacing pushes half of it out of sight.
  • Clamp a description by hand with max-h-[3rem] overflow-hidden on a card that links nowhere, so the person never learns that the shift needs closed-toe shoes.
  • Give a card a fixed height without overflow-hidden, so its text runs over the Sign up for shift button below it.
  • Give the tabs Open shifts, My shifts and Swap requests w-28 truncate, so they read "Swap reque…" under the wider spacing, with no way to read the rest.
  • Add !leading-tight or !tracking-tight to body text. The criterion does not forbid !important as such, but it can stop a person's own spacing from taking effect, so we advise against it on these properties. That is our own advice.

Exceptions

  • A script that lacks a property. Text in a writing system that does not use one of the four properties, such as paragraph spacing in some scripts, is tested only on the properties it uses.
  • Truncation with a way to the whole. Let text wrap or its box grow first. Where that cannot be done, an ellipsis is acceptable when it is clear that more can be seen and the full text is one step away, such as a card that is visibly a link to a page with the text in full. A tooltip may be that way only when the visible part still tells the item apart from the others and is enough to use it, and it opens on focus too; what the person needs stays on the page (TXT-002b).
  • The person's tool fails. If an extension or bookmarklet cannot apply the values, the page is not at fault, unless the page itself stops them.
  • Images of text and captions in the picture. Text in an image, text drawn on a canvas and captions burned into a video's picture are outside this rule.
  • Neighbouring rules. Text that grows in size is LAY-003a, and reflow at 320 pixels is LAY-001, which covers truncate and line-clamp-* at that width.

Verdict

Requirement. Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on LAY-003b
SourceRoleStancePage
WCAG 2.2LawRequires1.4.12 Text Spacing
WCAG 2.2LawSupports1.4.4 Resize Text
Material DesignJudge SupportsWriting and text: Text truncation
Apple Human Interface GuidelinesJudge No position
Carbon Design SystemJudge No position
GOV.UK Design SystemExpert witness No position
Nielsen Norman GroupExpert witness No position

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Layout: 4 rules and 0 guidelines · All rules