telerik / kendo-themes

Monorepo for SASS-based Kendo UI themes
149 stars 71 forks source link

Ocean Blue swatch violates accessibility criteria for contrast #3724

Closed dtopalov closed 1 year ago

dtopalov commented 2 years ago

Describe the bug When the Default theme Ocean Blue swatch is applied, multiple accessibility criteria for contrast across multiple components are violated.

To reproduce Some of the examples include (but there are probably much more, for example buttons in toolbars scenarios):

  1. The focus indicator of the PanelBar has a contrast ratio of 1.32:1. Should be at least 3:1: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance-minimum.html
  2. Dropdowns - Focus state contrast ratio is 1.19 against the background – against the border of the element is 1.1, both of which fall below the Contrast ratio minimum.
  3. Grid - Contrast ratio of the focus indicator is 1.16.
  4. Gantt - Contrast ratio of the selected timeline item is 2.16.
  5. Button - https://www.aditus.io/button-contrast-checker & https://runner.telerik.io/fullscreen/IXopEHeR

Expected behavior When the swatch is applied no WCAG criteria related to contrast ratio are violated across all components and suites.

Affected package

Affected suites

Affected browsers

Build system information (please remove the unneeded items)

Additional context All Kendo products are undergoing a major effort for improved compliance with the accessibility standards and best practices. Having a theme/swatch that complies with all established requirements is an integral part of delivering accessible and compliant components.

veselints commented 2 years ago

Automation of the test process may be based on: https://github.com/telerik/kendo-themes/issues/2468

jivanova commented 2 years ago

When fixing the issue keep in mind the WCAG 2.2. compliance requirements:

Accessibility Criteria **2.4.11 Focus Appearance (Minimum) Level AA** When solid (not dashed) and fully enclosing the element, the focus indicator must have: Minimum area (thickness) (1px). Minimum contrast ratio against its background (3:1). Minimum contrast ratio against the same pixel the indicator is displayed on when no focus is present (3:1). Minimum contrast ration against any parts of the focused element that are adjacent to the indicator (3:1). https://w3c.github.io/wcag/guidelines/22/#focus-appearance !!! We must also review 1.4.11 Non text contrast Level AA compliance in all states of our controls and focus indicator is present. https://w3c.github.io/wcag/guidelines/22/#non-text-contrast **2.4.12 Focus Not Obscured (Minimum) Level AA** – We must review the components having scrollable content and ensure there is no state in which focused element remains outside of the currently visible scrollable area. https://w3c.github.io/wcag/guidelines/22/#focus-not-obscured-minimum **2.4.13 Focus Not Obscured (Enhanced) Level AAA** – same as above https://w3c.github.io/wcag/guidelines/22/#focus-not-obscured-enhanced

In addition, let's have a testing solution for color-contrast as well. https://github.com/telerik/kendo-themes/blob/develop/packages/default/scss/core/functions/_colors.scss

In case the evaluation of the report needs design, please update the parent issue with design & front-end R2 planning:

https://github.com/telerik/web-components-planning/issues/125

veselints commented 2 years ago

Implement WCAG contrast ratio testing

veselints commented 1 year ago

Scenarios in which focus indicator fails WCAG 2.1 SC 1.4.11

After a huge effort from Dimitar, he managed to reduce the focus indicator contrast issues to the following set:

veselints commented 1 year ago

Scenarios in which text contrast fails WCAG 2.1 SC 1.4.3

veselints commented 1 year ago

Suggested text that can be added to the docs and the VPAT, so those properly represent the state of our components: BottomNavigation, ColorPalette and Rating fail WCAG success criteria 1.4.11 Non-text contrast for the focus indicator on its items.