Problem/Motivation
Note that this issue was initially being discussed here: #3083657: Devise strategy to address several SVG loading+usage issues, but that issue became a larger meta for many SVG issues due to it having the most useful information overall.
Claro has many CSS background images. These are stripped out by Internet Explorer and Firefox, but Edge displays them.
When Windows high contrast themes were originally introduced, IE and Firefox policy was to strip out all CSS background image, on the assumption that they interfered with the legibility of text that was on top of them. Early versions of Edge did this too, but later Edge changed the policy to display background images, but enforce a plain background in places where text was on top of a background image.
Some of these icons may include essential information. In those cases they can't be background images.
Proposed resolution
This is compatible with the approach agreed upon in #3083657: Devise strategy to address several SVG loading+usage issues
- Find uses of background images that include information that high contrast mode users should be able to see
- These uses can be addressed on a case-by-case basis using whatever solution seems to work best.
- This could be providing text in lieu of an image
- The image could be provided with a different mechanism: using SVG-in-HTML, or (in D10) CSS mask-image or clip-path. They would need to be accompanied by a comment noting why the usual approach of background: url() is not used in order to support high contrast mode
Remaining tasks
- DONE: they all warrant being shown. Identify background images that should be available to high contrast mode users.
- Refactor so these images (or the information provided by them) are available in high contrast mode. Use child issues on a case by case basis.
Components to be updated
Next/prev icons in pagersection chevron on admin/configAll of the icons on /admin/reports/statusaction link iconspassword indicatorprogress indicatorTabledragDropbutton chevronTablesort indicatorTablesort indicator in tables.css
User interface changes
Aims to make the visual design more robust and adaptable, to meet the needs of forced-colours users.
Testing instructions
1) You need to test this on a minimum of Microsoft Edge, Chrome, and Firefox using Windows High Contrast
2) Test the following components
- Next/prev icons in pager
- section chevron on admin/config
- All of the icons on /admin/reports/status
- action link icons
- password indicator
- progress indicator
Note for the action link icons: there’s no place where the icons are all visible. you can paste the following HTML into browser developer tools to test the icons.
<a href="" class="action-link action-link--icon-plus">Icon plus</a><br>
<a href="" class="action-link action-link--icon-trash">Icon trash</a><br>
<a href="" class="action-link action-link--icon-ex">Icon ex</a><br>
<a href="" class="action-link action-link--icon-checkmark">Icon checkmark</a><br>
<a href="" class="action-link action-link--icon-cog">Icon cog</a><br>
<a href="" class="action-link action-link--icon-show">Icon show</a><br>
<a href="" class="action-link action-link--icon-hide">Icon hide</a><br>
<a href="" class="action-link action-link--icon-key">Icon key</a><br>
<a href="" class="action-link action-link--icon-questionmark">Icon questionmark</a><br>
Followups
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 3130305-28-d10.patch | 62.2 KB | lauriii |
| #27 | 3130305-screenshots-2.zip | 2.72 MB | cindytwilliams |
| #26 | 3130305-screenshots.zip | 1.38 MB | cindytwilliams |
Issue fork drupal-3130305
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 #3
mgiffordTagging, also adding link to
https://accessabilly.com/accessibility-issues-concerning-windows-high-co...
Comment #5
andrewmacpherson commentedThe short answer is... ALL OF THEM. I don't really see any point in this issue.
This sounds misguided to me. You may as well ask whether users should be able to see them when they aren't using high-contrast mode.
Some of them are essential information, for example:
Some of them aren't essential (and don't warrant a text-alternative) but they still serve as recognizable and meaningful markers which users can become familiar with. Most of the toolbar items fall in this category; they accompany the visible text labels which say what they do.
Whichever category they fall in, I can't think of any icons in our admin interface which are displayed in author-colours* mode, which won't be EQUALLY useful, recognizable, and informative to users in a forced-colours mode. Put another way: you'd miss them if they weren't shown in author-colours mode.
I think a more pertinent question is: do any of our icons rely on a particular colour, which amounts to a failure of WCAG SC 1.4.1 Use of Color?
If not, then there's no reason they can't adapt to forced-colours mode. The vast majority are monochrome icons anyway, and don't rely on gradients or shadows.
If any icons do fail WCAG Use of Color they should be fixed in both the author-colour and forced-colour modes. The yellow-star design for the shortcut module is an example of this, which already has a new design proposal.
Ahem, this isn't actually true.
WCAG doesn't care how the image (or it's text alternative) is implemented. For example, see my pedantic folly on CodePen: Text alternative for a CSS background image. It conforms to WCAG SC 1.1.1, but has little to commend it. It could be useful for the full-bleed hero images in Umami.
A common technique for providing a text alternative for a icon is to put a visually-hidden span inside the link, button, or whatever. We already do this in various places.
Background images can be used in forced-colours modes. All of our supported browsers on Windows can have CSS background-image overridden (or restored in the case of MSIE) using a forced-colors media query. It's certainly feasible to have a set of variant SVG images which use system-colours. We already have
WindowTexticons in Claro, for example the wastebin icon for the node form's delete button. (It should be ButtonText, mind, since it's used inside a button.)* I made up the term "author-colours" mode to distinguish from forced-colours mode. It hasn't caught on, yet. I dislike the term "normal colours". I'm trying out "full-colour mode" too.
Comment #7
mherchelUpdating title summary.
Comment #8
mherchelRemoved note suggesting use of
content: url(), as this doesn't work on chromium based browsers.Comment #9
mherchelComment #10
mherchelComment #11
mherchelMy thought on this is to update the following components in this issue using CSS
image-mask(note this isn't supported under IE11) for both 9.4.x and 10.0.x. We can create a followup for IE11 (that likely will not ever get fixed) if necessary.However, there will undoubtedly be some stragglers that aren't included in the above list. To keep this reasonable, I say that once identified, they can become followup issues (to keep this patch manageable and prevent creep)
Before I start work, I'd love to get input on this from @ckrina and @lauriii
Comment #12
saschaeggi@mherchel do you mean
mask-image? Like we use in Gin? Totally up for it, also can be used together with SVG fragments.For support also see also #3205375: [Plan] Move to SVG fragments (blocked by FF esr)
Comment #13
mherchelYep. https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image. It's supported in all supported browsers except for IE11. It can be combined with CSS system colors (like
CanvasTextorLinkText) to render the shape of the icon in forced colors mode.The various properties (
mask-size, etc) all have equivalent properties tobackground-image, so it's an easy way to make it compatible with forced colors using CSS alone.https://codepen.io/mherchel/pen/YzYZGKV
Comment #14
saschaeggi@mherchel yes, we use it for a while now in Gin for accent coloring icons, darkmode and other stuff. You can have a look at the implementation. It works great. And as mentioned before we use it together with SVG fragments for an even better (& smaller) integration.
Comment #15
mherchelComment #17
mherchelComment #18
mherchelComment #19
mherchelComment #20
mherchelJust updated the action links. Not sure where in the UI we can view all of these, however, you can paste the following HTML into browser developer tools to test the styling:
Comment #21
mherchelComment #22
mherchelComment #23
mherchelComment #24
mherchelComment #25
mherchelComment #26
cindytwilliams commentedHere are screenshots from where I tested the following on Windows 10 with a high contrast theme using Microsoft Edge, Chrome, and Firefox:
All icons and indicators were displayed. Marking RTBC.
Comment #27
cindytwilliams commentedHere are some more screenshots that show the following in Edge and Firefox:
Comment #28
lauriiiComment #31
lauriiiCommitted 3adb15f and pushed to 10.0.x. Also committed to 9.4.x. Thanks!
Leaving open for backport to 9.3.x after the patch release.
Comment #33
lauriiiCherry-picked to 9.3.x. ✌️