Good afternoon,
In order to reach WCAG 2.1 AA compliancy, there are some changes needed to the XWiki color themes.
First of all, since those changes are quite small (variation on a few colors of the main theme), I think this wouldn’t be a bad idea to update the default color theme (Flamingo → Iceberg) with these changes instead of creating a new “special WCAG” theme.
I used a couple of firefox addons for accessibility to point out contrast issues on the Main View (http://localhost:8080/xwiki/bin/view/Main/)
First, a WAVE analysis (WAVE Accessibility Extension – Get this Extension for 🦊 Firefox (en-US))
ID | Element | Foreground Color | Background Color | Current contrast ( /1) | Contrast description | Proposed solution | Proposed value |
---|---|---|---|---|---|---|---|
1 | Menuhorizontal > wikilink > a | #FFFFFF | #3E7CBC | 4.36 | White on light blue | Make the bg darker | BG #3E79BC |
2 | id=“hierarchy” class=“breadcrumb breadcrumb-expandable” > active space dropdown > a | #777777 | #F8F8F8 | 4.21 | Grey on very light grey | Make the fg darker | FG #727272 |
3 | xdocLastModification | #777777 | #FFFFFF | 4.47 | Light grey on white | Make the fg darker | FG #727272 |
4 | Doc-tags , xdocTags | #777777 | #FFFFFF | 4.47 | Light grey on white | Make the fg darker | FG #727272 |
5 | Xwikitabbar > li active > a > itemCount | #777777 | #FFFFFF | 4.47 | Light grey on white | Make the fg darker | FG #727272 |
6 | Navigation panel → jstree-clicked | #3173B5 | #EEEEEE | 4.25 | Blue on light grey | Make the fg darker | FG #2F6FAF |
7 | Footer xwikiplatformversion a | #FFFFFF | #3E7CBC | 4.36 | White on light blue | Make the bg darker | BG #3E79BC |
This analysis first returned 28 contrast violations. In order to correct these issues I found out that a few changes in the color themes variables were enough:
- @navbar-default-bg : #3E7CBC → #3E79BC
- @link-color : #3173B5 → #2F6FAF
- Custom properties: @gray-light:#727272; (from #777777)
Note : Changing this value is convenient because it’s used in multiple elements at various places in the interface. However, it might create some other contrast issues such as on the Create Page where it clashes as a foreground on a highlighted background.
After those fixes, a WAVE analysis reports 4 violations on the page. Three of those are about hidden elements and can be overlooked for now. The fourth one is about the [+] symbol in the tag node (ID = 4). This element uses a variable from the old color themes that did not get a field in the new color theme (can’t edit in a few clicks).
Second, a Firefox inspector check:
ID | Element | Foreground Color | Background Color | Current contrast ( /1) | Contrast description | Proposed solution | Proposed value |
---|---|---|---|---|---|---|---|
1 | Breadcrumb carets | #ccc | #f8f8f8 | 1.51 | Light grey on very light grey | Make the FG darker | #727272 |
2 | Breadcrumb separator | #ccc | #f8f8f8 | 1.51 | Light grey on very light grey | Make the FG darker | #727272 |
(3) | Youtube video title | NAN | NAN | NAN | NAN | NAN | NAN |
4 | Like-number in like-button | Gradient #6296cb,#3E7CBC 50%,#386fa9 | #fff | 3.11, 4.36, 5.23 (effective 3.8→ 4.81) | White on a gradient from dark blue to light blue | Make the BG light part darker | |
5 | [+] in tags | #777 | #fff | 4.48 | Light grey on white | Make the fg darker | FG#727272 |
This analysis returns a total of 6 violations.
In order to solve some of these, we apply changes:
- @breadcrumb-color: #727272
Note: This would be the largest change, making breadcrumb ‘characters’ way more visible. This makes the breadcrumb more visible, which could be negative on user’s focus on the actual content of the page. - @btn-primary-bg: #386da7
Note: This change in lightness could be reduced a lot if the range of the gradient on the button was reduced. Right now the “dark” part of the gradient has enough contrast, but even the “middle” part of the gradient is not contrasted enough, so a change of this center value is needed anyways.
After this, only two violations are reported: the [+] for tags, and the video title.
At last, I performed two analysis with Axe DevTools (axe DevTools® - Web Accessibility Testing – Get this Extension for 🦊 Firefox (en-US)) and IBM Accessibility Assessment (IBM Equal Access Accessibility Checker – Get this Extension for 🦊 Firefox (en-US)).
No additional violation was found out.
By changing a few colorTheme variables, we can reduce drastically WCAG contrast violations on the main theme.
Initial color theme
Updated color theme
Thanks for reading this proposal! I’m looking forward to your feedback, especially on the “gray-light” and “breadcrumb-color” changes.