Text spacing accessibility means visitors can increase the space between lines, paragraphs, letters, and words while keeping the page readable and usable. Before launch, apply spacing overrides to the deployed page, inspect content that grows, and repeat the main task without clipped labels or overlapping controls.
A portfolio card can look correct at every breakpoint yet lose its last sentence when someone adjusts letter spacing. A form can keep its width while a fixed-height button cuts off its second line. This guide gives developers a repeatable test for those failures and CSS changes to investigate.
Text spacing accessibility checklist
- Open a representative public route and record its normal appearance.
- Apply all four WCAG spacing values together and verify they took effect.
- Read headings, cards, labels, instructions, and error messages in full.
- Open navigation, disclosures, and dialogs used in the main task.
- Repair the component that constrains the expanded text.
- Retest with the overrides, then restore normal styles and check again.
- Keep screenshots, tested states, and a focused regression check with the release.
Start with a page containing real content, including your longest supported labels. A row of short placeholder titles rarely exercises the constraint that fails in production. Use the broader accessibility checks before launch for the rest of the review.
Understand the WCAG text spacing requirement
WCAG 2.2 Success Criterion 1.4.12 is a Level AA requirement about adapting to user spacing changes. Its test values are line height of 1.5 times the font size, space after paragraphs of 2 times the font size, letter spacing of 0.12 times the font size, and word spacing of 0.16 times the font size. Apply them together without changing unrelated style properties. Content and functionality must remain available. See W3C's Text Spacing explanation.
These values do not prescribe your default visual design. You also do not need to add a settings panel simply to expose them. The page needs to tolerate overrides. The criterion includes an exception for languages and scripts that do not use one or more of these spacing properties; test the properties relevant to the content's writing system.
Keep spacing review separate from zoom and narrow-width review. A page that passes one can still fail another. Run each check under recorded conditions so the cause of a failure stays clear.
Apply a text spacing testing stylesheet
For a typical left-to-right HTML page, add this temporary stylesheet through a user-style extension or your browser's developer tools. It is a test override, not a production reset:
* {
line-height: 1.5 !important;
letter-spacing: 0.12em !important;
word-spacing: 0.16em !important;
}
p {
margin-block-end: 2em !important;
}
Before reviewing the layout, inspect computed styles on a paragraph and a control. For text at 16 CSS pixels, these settings produce a 24-pixel line height, 1.92-pixel letter spacing, and 2.56-pixel word spacing. The paragraph's end margin is 32 pixels. Unitless line height scales with each element's own font size; MDN explains the inheritance behavior in its line-height reference.
Confirm the override wins against component rules, including inline styles marked important. If your starting design already uses larger values, preserve those larger values for the review rather than reducing them. Check how paragraphs are represented: this sample targets p elements, so paragraph-like custom components may need an additional selector. For vertical writing, review the appropriate paragraph-spacing direction with someone familiar with the script.
These selectors do not reach inside iframes or shadow roots, and the universal selector does not select pseudo-elements. Inspect meaningful generated text and embedded components separately. An icon font changing shape is a reason to inspect the icon implementation, not a reason to exclude readable button text from testing.
W3C's spacing override technique C35 describes using user styles, extensions, or other tools and allowing text containers to grow. If an injected stylesheet is blocked, use an appropriate user-style tool and verify computed values; keep the site's production security policy intact.
Find CSS text clipping in real task states
Scroll through the entire route with the override active. Compare the visible words with the DOM text and the baseline screenshot. Look for the missing end of a heading, text painted over another card, or a button whose label extends beyond its background.
Then exercise the page:
- Open the navigation and read every destination label.
- Expand help text and disclosures; check the content below them moves down.
- Show a validation error and confirm its full instructions remain readable.
- Open a dialog and reach its last action with the keyboard.
- Read badges, prices, and status messages beside longer text.
Use test data and harmless actions for forms. The website form testing checklist covers validation and recovery beyond the spacing check.
Inspect the nearest constraining ancestor when text disappears. Common causes include a fixed height, overflow: hidden, absolute positioning, or a single-line label forced into a narrow container. W3C's failure technique F104 documents clipping and overlap after spacing changes.
A page without horizontal scrolling can still clip text: an ancestor can hide expanded text without widening the document. For failures that also cause page-wide scrolling, follow the horizontal overflow CSS debugging guide.
Let text containers grow instead of hiding the failure
Consider a course-card action with a fixed 36-pixel height, nowrap text, and hidden overflow. Increased spacing can force its label outside the available area. A component-level repair could look like this:
.course-card {
display: flex;
flex-direction: column;
min-width: 0;
height: auto;
}
.course-card__action {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 2.75rem;
height: auto;
max-width: 100%;
padding: 0.625rem 1rem;
white-space: normal;
overflow: visible;
text-align: center;
}
Replace the conflicting component rules rather than appending this beneath an unknown cascade. Check the card's parent grid as well: a repaired button can still overlap the next row if an ancestor keeps a fixed track height. Keep sufficient space between neighboring controls after they wrap.
The repair allows an ordinary action label to wrap and its container to expand. MDN's white-space reference explains how the property controls wrapping. Test your actual labels and translated content; a particular minimum height cannot guarantee that every label fits.
Avoid shrinking the font, reversing the user's spacing with more important rules, or hiding the final line to restore the original screenshot. If truncation is intentional, verify a usable way to access the complete information in both presentations. Changing the screenshot is acceptable; losing the information or action is the failure to fix.
Keep a focused browser regression check
Once you have repaired a component, capture its expanded-text state in your existing Playwright suite. This example assumes an owned course-page fixture with one .course-card and a paragraph description. Replace the route and selectors with stable fixtures in your project:
import { test, expect } from '@playwright/test';
test('course card keeps its spacing override layout', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('https://your-site.example/courses/demo');
await expect(page.locator('.course-card')).toBeVisible();
await page.addStyleTag({ content: `
* {
line-height: 1.5 !important;
letter-spacing: 0.12em !important;
word-spacing: 0.16em !important;
}
p { margin-block-end: 2em !important; }
` });
const description = page.locator('.course-card p').first();
await expect(description).toHaveCSS('line-height',
await description.evaluate((element) =>
`${parseFloat(getComputedStyle(element).fontSize) * 1.5}px`
)
);
await expect(page.locator('.course-card')).toHaveScreenshot(
'course-card-text-spacing.png'
);
});
Playwright provides stylesheet injection through addStyleTag and screenshot comparison assertions. Create the initial baseline only after manually confirming that every word and action is available. Use fixed content and fonts so unrelated changes do not dominate the comparison.
This check confirms one computed property and compares one component image. It does not verify all four values, detect every clipping mechanism, or prove operability. Verify the full override manually, add other states that previously failed, and review screenshot changes before accepting them. Keep keyboard and task assertions in the surrounding suite. Record the browser, viewport, build, and fixture with your website regression testing evidence.
Check the public release with Slop Audit
After repairing spacing failures, run Slop Audit on the public page to review the surrounding launch conditions. When its browser stage is available, Slop Audit collects axe accessibility findings, bounded keyboard-focus observations, mobile layout checks, and viewport screenshots. Use the report's evidence and coverage labels to prioritize the next repair.
Slop Audit does not currently apply this text-spacing stylesheet or provide a dedicated WCAG 1.4.12 test. Its normal viewport screenshots cannot show how the page behaves under your spacing override. Keep this manual review and the focused browser check alongside the report; an automated result cannot certify accessibility conformance.
For sign-off, retain the route, spacing values, affected selector, before-and-after screenshots, and task result. Remove the temporary override and retest the default presentation before handing the release to its reviewer.