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 Seven theme pre-dates WCAG 2.1, so addressing this criterion in Claro is a great way to follow modern accessibility practices.

Note: Claro doesn't have to use these minimum dimensions in it's own stylesheets. Rather, this is about making sure Claro 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 Claro'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.

Targets for Beta stage (should-haves)

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 at beta stage.

  • 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.

Targets for Stable stage (must-haves)

Assess a full range of special components and pages. Include scenarios combining WCAG "Text Resize" and "Reflow" success criteria too.

Components

  • Tables, e.g. the content or user listing, a draggable table, and a multi-value text field widget.
  • Content inside dialogs, e.g. Views UI dialogs.
  • Content inside vertical tabs. The emails templates on the user account settings.
  • Content inside details/summary.
  • The node meta details groups
  • Message blocks.
  • Help block at the start of a page
  • drop buttons
  • long breadcrumbs

Special pages

  • The status reports page.
  • Appearance (theme list)
  • Extend (modules list)
  • admin/config
  • A Views config page
  • Image style config pages.
  • Others...?

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).
    • Repeat these scenarios with and without the admin toolbar open in vertical orientation.

Must haves:

None added yet

Should haves:

#3164806: Purpose of filters fieldset on admin pages is unclear when zoomed in, and for cognitive accessibility
#3164587: Text resize on wide screen layout also causes reflow to single column, making the layout too wide

Could haves:

#3164800: Accordions on content form are difficult to understand when using system or browser zoom preferences

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

Issue summary: View changes
andrewmacpherson’s picture

Issue summary: View changes
andrewmacpherson’s picture

Issue summary: View changes
andrewmacpherson’s picture

Issue summary: View changes
huzooka’s picture

Assigned: Unassigned » huzooka
andrewmacpherson’s picture

Issue summary: View changes
katannshaw’s picture

@andrewmacpherson: I did the initial testing for "Targets for Beta stage (should-haves)" with the text spacing bookmarklet applied and a 2em bottom margin. Here's my findings:

1. Styleguide with text spacing applied and 2em bottom margin:
Online screenshot: https://monosnap.com/direct/Ahss7g34O2PH8eStN3Dq9cPzdzWvyu
Attached screenshot: styleguide-text-spacing-10102019.png

CSS added to page:

table,
.pager ul,
.breadcrumb ol,
.progress,
code {
	margin-bottom: 2em;
}

p,
.item-list ul,
.item-list ol,
.item-list dl,
ul.links,
ul.inline,
blockquote,
h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block-end: 2em;
}

2. Forms without errors
Online screenshot: https://monosnap.com/direct/tULfuCiNHI1WbN1QzEgDYyr6JRsTdp
Attached screenshot: errorfields-witherrors-text-spacing-10102019.png

3. Forms with errors
Online screenshot: https://monosnap.com/direct/vrgmaSEGShSvA3a9Z8E4ex0kt4pLnX
Attached screenshot: errorfields-withouterrors-text-spacing-10102019.png

CSS added to page:

.form-item {
	margin-bottom: 2em;
}
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs work

Test env:

  1. Drupal 8.9.x [0fe72eb470]
  2. Custom package in composer.json:
    {
        "type": "package",
        "package": {
            "name": "dmsmidt/errorstyle",
            "version": "0.1.0",
            "type": "drupal-module",
            "dist": {
                "url": "https://github.com/dmsmidt/errorstyle/archive/8354901446cbd473eadc82c9d6426d649998c32a.zip",
                "type": "zip"
            }
        }
    }
    
  3. Drupal installed with Standard install profile
  4. drush en errorstyle styleguide -y
  5. drush [th]en claro -y
  6. Frontend theme for Style Guide: drush config-set system.theme default claro
  7. Admin theme for Error styles: drush config-set system.theme admin claro

I've updated the bookmarklet, it can be found here (repo). Changes:

  1. li, h1, h2, h3, h4, h5, h6 also get the 2em bottom margin (as described)
  2. Div with these classes also gets the 2em bottom margin

Scenarios runned (default state shots prefixed with 00):

  1. 01: 200% browser zoom with bookmarklet; toolbar collapsed
  2. 04: 960px canvas width; toolbar collapsed
  3. 05: 300% browser zoom with 960 (CSS)px canvas width; toolbar collapsed

Missing scenarios (these should be specified first):
* 02: Viewport width somewhere in the middle of the portrait tablet breakpoint range
* 03: Viewport width in the mobile breakpoint range.
* All the test scenarios [1, 2, 3, 4, 5] with (vertical) toolbar.

Updated bookmarklet:
* Source code.
* GH page.

huzooka’s picture

StatusFileSize
new8.69 MB

I forgot to add the partial resources.

huzooka’s picture

Project: Claro » Drupal core
Version: 8.x-2.x-dev » 8.9.x-dev
Component: User interface » Claro theme
andrewmacpherson’s picture

#8: Thanks @katannshaw - that's a great start. No issues in those screenshots/

#9: Cool, I'll try the new bookmarklet soon. BTW the original license for dylanb's bookmarklet is MIT. You should probably add that to your repo. See https://github.com/dylanb/dylanb.github.io

#10: Aha, that's a nice big zip file. I'll take a detailed look soon.

I don't see vertical tabs on any screen shot. I'd expect to see some at the bottom of the error style page. Is the vertical tabs issue included in what you tested?

Which version of Claro was used? Contrib 1.x, contrib 2.x, or the alpha just added to core?

There's an overflow issue on 05-Claro-admin_appearance_styleguide--960-300-bml.png. It's the grey box near the top of main content, with the big list of links. That's from the styleguide module. Do you think the overflow issue there is anything to do with Claro?

Some of these screenshots will suffice for the Text Resize or Reflow survey issues.

TODO:
If we can get the vertical tabs, then I'd say we have all we need for the beta-stage survey. When vertical tabs has the extra summary message, that's a crowded thing that could break with extra spacing or zoom.

huzooka’s picture

Re #12:

First of all, thanks for highlighting the missing license! I just fixed that :)

I don't see vertical tabs on any screen shot.

Vertical tabs is there. This is that:

Actually, we are using a really big media breakpoint for displaying the real vertical tabs, that's why you cannot find the expected UI neither on the 1280(CSS)px wide screenshots I've made.

Which version of Claro was used?

The one that was merged into Drupal core 8.9.x [commit: 0fe72eb470].

Others:

I just noticed that the end of every screenshot is messed up. (No idea why, they look fine in Firefox browser.)
I think that I'll re-generate these screenshots manually tomorrow (I'm in CEST right now).

The ones I shared in #10 were taken in Firefox, with the built-in Firefox dialog.
In Chrome, I was unable to take page captures with lower or higher page zoom than 100%.

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Steps to reproduce my test instance:

  1. Get Drupal core codebase with commit hash 56f670c861 (8.9x):
    git clone --branch 8.9.x https://git.drupalcode.org/project/drupal.git
  2. Add my errostyle fork [1]: composer config repositories.'zolhorvath/errorstyle' github https://github.com/zolhorvath/errorstyle.git
  3. Require Style Guide and the Error Style modules: composer require drupal/styleguide zolhorvath/errorstyle This will trigger the installation of other required extensions as well.
  4. drush si standard -y
  5. drush en errorstyle styleguide -y
  6. drush [th]en claro -y
  7. drush cset system.themes default claro -y

Scenarios I've runned (on Chrome):

  1. 1400px browser canvas width, zoom 200%, with bookmarket changes
  2. 800px browser canvas width, default zoom, no bookmarket
  3. 360px browser canvas width, default zoom, no bookmarket
  4. 960px browser canvas width, default zoom, no bookmarket
  5. 960px browser canvas width, zoom 300%, with bookmarket changes

Since the vertical toolbar is fixed for cases #3 and #5, I skipped these for the 'with-toolbar-vertical' screenshots.

The shots prefixed with 0 represent the default state, with 1400px browser canvas size.

Things I noticed during the test:

  1. Inline lists are overflowing from the available space
  2. On the Error style testform, the year input of Datelist also overflows with 700(CSS)px canvas width, with vertical toolbar.
[1]
I've three commits in my fork on the top of the referenced module:
andrewmacpherson’s picture

Title: Assess Claro's conformance with WCAG SC 1.4.12 Text spacing » Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow.

#15 - great, I see the vertical tab styles now.

Over in #3066007: Roadmap to stabilize Claro, I originally thought it would be best to survey WCAG "Text spacing", "Text resize", and "Reflow" success criteria in their own issues.

However, with the detailed plan and workflow that has emerged here, I think we can treat these as a combined survey. I've updated the roadmap issue to reflect that.

andrewmacpherson’s picture

Issue summary could do with a small update to explain the new scenarios from #15 and scope from #16.

katannshaw’s picture

@andrewmacpherson and @huzooka: Looks like you guys are on a roll. Let me know if you need any testing after you've finished everything.

-Kat

andrewmacpherson’s picture

@katannshaw - getting screenshots of the special pages mentioned in the issue summary is the next step to move this along.

fhaeberle’s picture

Should we postpone this until the designs and implementations of the "special" pages are ready? Because this is currently blocked on the design and implementation of the updated page designs.

As note of those who weren't involved: In Claro's development we first focused on the components rather than redesigning the pages. Some of the pages already are ready because they only consist of the already finished components or were curical that Claro can be added to Core. Some of the pages aren't out of the components we already finished and additionally they define special layout or components like the status report page, therefore this needs to be designed and implemented (which is in the process right now and a stable blocker).

katannshaw’s picture

StatusFileSize
new5.46 MB

I've done additional testing for the "Special Pages" with the text spacing bookmarklet applied, a browser screen set to a 1400px width, and a 2em bottom margin using the following code:

p,
card,
.item-list ul,
.item-list ol,
.item-list dl,
ul.links,
ul.inline,
blockquote,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block-end: 2em;
}

table,
.pager ul,
.breadcrumb ol,
.progress,
code,
.form-item {
  margin-bottom: 2em;
}

My findings can be found in the attached zip file containing 16 before/after screenshots. I noticed that the arrows in the dropdown menus don't adjust properly when the text spacing is applied. You can see this in the Blocks, Image Style, and Views. The Edit Views page is also very scrunched up, but I believe that would be handled by the crew maintaining the Views module. I plan on working on the Scenarios pages next.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

rainbreaw’s picture

andrewmacpherson’s picture

Just a note to say that dmsmidt/errorstyle is no longer developed; it's been replaced with drupal//form_style. Basically we moved it to drupal.org to give it more prominence, and make it easier to install. I expect we'll use it to assess Olivero too. We changed the name of the module, because it's useful for testing form styling with or without errors. A few new features are in the works too.

Re. #20:

Should we postpone this until the designs and implementations of the "special" pages are ready? Because this is currently blocked on the design and implementation of the updated page designs.

There's no value in postponing this issue, because it isn't blocked by those. Rather, assessing conformance here is something that can be done on an ongoing basis until Claro can be marked stable. What we already have could break at any time. Accessibility testing isn't something that we do at the end. Postponing it will just discourage people off testing as we go along.

When new pages are ready, the scope here grows.

dyannenova’s picture

Title: Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow. » [META] Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow.
Issue summary: View changes

Updated description with new link to Form Style module and marked this as a meta issue, since it will be used for ongoing tracking of related accessibility issues.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

katannshaw’s picture

StatusFileSize
new127.44 KB

Posted comment in wrong issue. This can be deleted. Sorry.

volkswagenchick’s picture

Issue summary: View changes
Status: Needs review » Active
Issue tags: +Easy Out of the Box

As per Comment #25, I am moving this issue back to active as it is now a meta issue for tracking related accessibility issues.

Adding @rainbreaw's child issues to the summary for wider visibility.

Tagging Easy Out of the Box

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lauriii’s picture

Status: Active » Reviewed & tested by the community

I believe this issue should be considered as done. Marking as RTBC for visibility.

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

This has received significant testing by @katannshaw in #8 and #21, @huzooka in #9, #10, and #14, as well as @rainbreaw in #23. Issues have been filed for the bugs that have been discovered.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.