(credit for writing this issue summary goes to @andrewmacpherson, as this is largely pasted in from the issue he created here: #3087225: [META] Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow.
Problem/Motivation
WCAG 2.1 introduced success criterion 1.4.12 Text spacing:
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 Bartik theme pre-dates WCAG 2.1, so addressing this criterion in Olivero is a great way to follow modern accessibility practices.
Note: Olivero doesn't have to use these minimum dimensions in it's own stylesheets. Rather, this is about making sure Olivero doesn't break when someone overrides the author styles with a user stylesheet (e.g. with a browser extension like Stylish).
Note that the word "paragraphs" in WCAG is the general English sense. It doesn't exactly mean the HTML <p> element.
Proposed resolution
Assess Olivero's conformance with WCAG 1.4.12 Text spacing.
Apply the specified spacing dimensions, and see if anything breaks. Before-and-after screenshots are good evidence of testing.
Make child issues to fix any problems found for particular pages or components.
Useful tools
- Styleguide module.
- Form Style module. This provides a page which has all core form elements. Press submit, and you them all marked with errors. Works with and without Inline Form Errors module enabled. The module was originally developed for manual testing of the Inline Form Errors module, but it's handy for robustness tests like this too.
- Dylan Barrell's Text Spacing Bookmarklet. When activated, this adds these brute force CSS rules:
* { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; } p, li, h1, h2, h3, h4, h5, h6 { margin-bottom: 2em !important; }These are the sort of thing someone might put in their user stylesheet.
Note: the bookmarklet doesn't add 2em space after everything that might qualify as a paragraph under WCAG. It will be a good idea to test with 2em after DIV wrappers for things like form errors, form descriptions, and messages.
Background reading
These have examples of the kind of problems which can occur. Content hidden in overflows is a common problem.
- Understanding Success Criterion 1.4.12: Text Spacing
- WCAG 2.1 – What is Text Spacing?
- Exploring WCAG 2.1 — 1.4.12 Text Spacing
Remaining tasks
Complete a first-pass survey of WCAG 1.4.12 Text Spacing. A few full-page screen captures from the styleguide test modules will provide a broad overview of how well the theme performs.
- Basic typography. A full-page screen capture from the Styleguide module as evidence here.
- All standard form inputs. A full page screen capture from the Error Style module as evidence here.
- Inline form errors. Use the Error Style module again.
- Form descriptions.
Note the bookmarklet doesn't apply the 2em bottom margin to DIVs. Use browser dev tools to add 2em after the form description and inline form error DIVs.
Assess a full range of special components and pages. Include scenarios combining WCAG "Text Resize" and "Reflow" success criteria too.
Components
- Determine components that should be checked for Olivero. The list from #3087225: [META] Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow. is not being used as that is for an admin theme. Some admin-y components should still be evaluated, but something like Views UI would not need to be considered.
Special pages
- Login form
- Search form
- More???
Scenarios
- Test in combination WCAG 1.4.4 Resize text. Set the browser zoom to 200%, then apply the bookmarklet.
- Test narrow viewports. Suggested approaches:
- Viewport width somewhere in the middle of the portrait tablet breakpoint range.
- Viewport width in the mobile breakpoint range.
- Also 960px window width on desktop. This is a common scenario when using window tiling to half the screen width on (a.k.a. Windows "Snap") on a HD monitor.
- Test in combination with WCAG 1.4.10 Reflow. Use the bookmarklet in a viewport 1280 CSS pixels wide, at 400% browser zoom (or 960px at 300% zoom).
Next Steps
Waiting on core accessibility maintainer @bnjmnm to confirm and close. I walked through this with @bnjmnm on this and we identified one followup issue (added below).
Followup issues
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | word-length.png | 444.16 KB | bnjmnm |
| #22 | avoidable-horiz.png | 428.08 KB | bnjmnm |
| #13 | Screen Recording 2021-04-22 at 17.55.06.mov | 9.01 MB | gauravvvv |
| #5 | 3190262-search-sm-screen.png | 48.43 KB | katannshaw |
| #5 | 3190262-search-lg-screen.png | 132.27 KB | katannshaw |
Issue fork drupal-3190262
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bnjmnmA reflow issue can be found on the search results page + a viewport with 320px width
The search input is wider than the viewport, which forces horizontal scroll overflow - which means it does not meet WCAG 1.4.10 Reflow
This should get its own issue.
Comment #3
bnjmnmUsing the test page from the Form Style module, it looks like the year input on a datelist field overflows past the viewport and forces horizontal scrolling where there shouldn't be. It's possible that this will have the same solution as #2 as I think they're both related to the size attribute. If that's the case, this can be addressed in the same followup as #2

Comment #5
katannshaw commented@bnjmnm I've created a patch for comments #2 &3. This is the first patch I've ever pushed up to drupal.org if you can believe it, so I hope that it works and that it's properly done. Please let me know if it works and if there's anything that I can improve. I'm ready for constructive criticism.
Attached are four screenshots of the fix in both small (320px) and large (1301px) screens. Thank you! -Kat
Comment #6
katannshaw commentedForgot to mark my patch as needs review.
Comment #8
mherchelCode looks good with this. I'm not sure why the automated tests are not passing. Re-queueing.
Comment #9
mherchelComment #10
mherchel@katannshaw - This is a meta-issue. @bnjmnm found the one issue, but we should open up a followup for this and post the patch there, and then we can leave this one open for the accessibility maintainers to sign off on once all identified sub-issues have been identified.
Comment #11
mherchelSplitting off #3192656: Text inputs can create horizontal scrolling at narrow viewports in Olivero
Comment #12
katannshaw commentedI checked the resizing of text and reflow using the Olivero Demo site and everything looks and works great as seen in these video screencasts. Marking RTBC.
RESIZE TEXT
Resize text (200%) style guide
https://monosnap.com/direct/vtRHVgrHTXudry8NoOYyqzYugmwOVO
REFLOW
1445px (desktop) style guide
https://monosnap.com/direct/Z8A2XWzI1vDfZVakuXBrPIXwtvKKzz
768x1024px (ipad portrait) style guide
https://monosnap.com/direct/nml4oMGYeRpM31NWd58phz2GmWbb42
1024x768px (ipad landscape) style guide
https://monosnap.com/direct/zPFWhJ5BttH7lOiki4bVipb2ClYNuK
375x812px (iphone portrait/landscape) style guide
https://monosnap.com/direct/yROQQeHIfdilpbcbARx9ztja3HEbxN
1445px (desktop) main nav
https://monosnap.com/direct/mJUrJJ2GDOTOOCRdQyCUl3bcdcHESB
768x1024px (ipad portrait/landscape) home
https://monosnap.com/direct/Exbm430wnSOXPmdgaVyu9XZ4yxmpev
375x812px (iphone portrait/landscape) home
https://monosnap.com/direct/LnQowt50MmRgrhZbxfYrkHaEXWIVcF
All screens reflow home
https://monosnap.com/direct/hlJdyGNza8pripcwdeg6i1ZSTrsvpF
Comment #13
gauravvvv commentedTested and verified on the live preview. https://tugboat-aqrmztryfqsezpvnghut1cszck2wwasr.tugboat.qa/form/example...
Looks good to me. RTBC +1
Comment #15
andrewmacpherson commentedIAssiging myself for review. The movies scoll a bit fast, to clearly see what's going on.
@katannshaw - how did you choose those viewport dimensions? Testing at 375 CSS pixels wide won't tell us whether it satisfies WCAG reflow, because 320 CSS pixels wide is the criterion's target.
Comment #16
mherchelChanging status to "needs work" so we can re-do the videos at 320px.
Comment #17
katannshaw commented@andrewmacpherson and @mherchel: Here are two new videos with viewports of 320px x 568px (portrait) and 568px x 320px (landscape). Hopefully they're a better speed. Let me know.
Pages Tested:
Home and Accessibility Basic: Video: https://monosnap.com/direct/DbHkIKYxKO8NApHp6v0uOmvUtgYbJT
Page Tested:
Accessibility Advanced Video: https://monosnap.com/direct/PfMROSl8ZifTjS6pUKJywqT621y9ev
Comment #18
mherchelThanks @katannshaw
Comment #19
mherchelComment #20
mherchelComment #21
xjmComment #22
bnjmnmI did a walkthrough with @mherchel https://youtu.be/q45j51C6mjY. Only one concern surfaced which is could be considered as within the scope of the following issue: #3177475: Olivero: Ensure long words break properly when zoomed in to provide proper reflow, but I'd like there to be a followup issue filed for the specific scenario of the preview images next to content titles pushing the title into forcing a horizontal scroll.

I'd like this to get its own as because
While it's certainly possible that there are additional scenarios that weren't caught during this evaluation, the review was comprehensive enough + the results good enough to consider 1.4.12 Text spacing sufficiently assessed and issues filed as needed. Once that targeted followup is created, I can consider this fixed.
Comment #23
mherchelFollowup created at #3229094: Olivero: Titles should wrap around images in teaser when necessary. Marking as fixed per #22
Comment #24
mherchel