Note: The creation of this article on testing Text Spacing was human-based, with the assistance on artificial intelligence.
Explanation of the success criteria
WCAG 1.4.12 Text Spacing is a Level AA conformance level Success Criterion. It ensure that content can adapt to user-defined text settings, making it easier to read. In content implemented using markup languages that support the following text style properties, no loss of content or functionality occurs by setting all of the following and by changing no other style property:
- Line height (line spacing) to at least 1.5 times the font size;
- Spacing following paragraphs to at least 2 times the font size;
- Letter spacing (tracking) to at least 0.12 times the font size;
- Word spacing to at least 0.16 times the font size.
The requirement is to ensure that when a user overrides the authored text spacing, content or functionality is not lost.
Who does this benefit?
- People with low vision who require increased space between lines, words, and letters are able to read text.
- People with dyslexia may increase space between lines, words, and letters to increase reading speed.
- Although not required by this SC, white space between blocks of text can help people with cognitive disabilities discern sections and call-out boxes.
Testing via Automated testing
Automated tools are a fast and scalable way to find potential WCAG 1.4.12 Text Spacing issues. They quickly scan CSS and inline styles, flagging hard-coded or restrictive text formatting that won’t adapt when users adjust spacing (e.g., to 1.5x line height or 2x paragraph spacing). This allows developers and testers to quickly identify elements that might fail accessibility checks across vast amounts of content.
However, automation has significant limitations. It can’t verify how text actually renders after spacing adjustments; that requires visual inspection. Automated tools also struggle with dynamic content and complex layouts, where spacing changes might lead to content clipping or overlapping.
Testing via Artificial Intelligence (AI)
AI-based testing offers a compelling approach to WCAG 1.4.12 Text Spacing audits, blending efficiency with advanced analytical capabilities. AI tools can rapidly scan vast amounts of content, pinpointing common spacing issues like irregular line height, letter spacing, and word spacing across diverse page elements. This provides a level of coverage and speed that far surpasses traditional manual testing. Moreover, AI can simulate various user settings or employ heuristic models to anticipate how spacing adjustments might impact readability, offering proactive insights.
Despite these advantages, AI-based testing faces limitations, particularly in fully grasping the nuanced impact of text spacing on user experience. AI may struggle to interpret how spacing affects individuals with cognitive or reading disabilities. While it can flag potential violations, it often lacks the contextual understanding or the ability to assess how text interacts with surrounding elements, factors critical for true accessibility. This can lead to false positives or the omission of subtle spacing issues that necessitate human judgment and empathy.
Testing via Manual testing
Manual testing for WCAG 1.4.12 Text Spacing offers unique insights that automated tools often miss. By manually adjusting key CSS properties like line height (1.5x font size), paragraph spacing (2x font size), letter spacing (0.12x font size), and word spacing (0.16x font size), testers can directly observe how a webpage reacts. This approach effectively mimics how users with low vision or reading disabilities customize text for readability, uncovering real-world accessibility issues such as overlapping text, cut-off content, or broken layouts.
However, this method isn’t without its challenges. It can be time-consuming, especially when testing numerous templates or viewports, and requires familiarity with browser developer tools. Without standardized procedures, results can be inconsistent due to subjective interpretations among testers. Despite these drawbacks, manual testing remains crucial for ensuring comprehensive support for user-customized text displays.
Which approach is best?
No single approach for testing 1.4.12 Text Spacing is perfect. However, using the strengths of each approach in combination can have a positive effect.
Achieving full compliance with WCAG 1.4.12 Text Spacing requires more than just one testing method. The most effective strategy blends automated, AI-based, and manual techniques to ensure no stone is left unturned.
Automated tools offer a quick initial scan, flagging potential issues like inline styles or CSS rules that could prevent users from adjusting text spacing. Think of them as your first line of defense, efficiently highlighting areas that need closer inspection.
While still evolving, AI-based solutions can simulate diverse user-defined text spacing preferences. These tools can efficiently identify visual layout problems, such as overlapping or truncated content, across large websites. This provides an excellent way to scale your testing efforts.
Ultimately, manual testing remains indispensable. By utilizing browser extensions, bookmarklets, or developer tools, you can precisely apply the WCAG-recommended spacing values: line height (1.5x), paragraph spacing (2x), letter spacing (0.12x), and word spacing (0.16x). This hands-on approach allows you to visually confirm that content reflows correctly without any loss of information or functionality.
This comprehensive, layered approach ensures both technical accuracy and a superior user experience, catching critical structural and visual failures that automated and AI tools might miss.