Text contrast (text-contrast)

Text smaller than 18pt (or 14pt bold) must meet a contrast ratio of 4.5:1 against its background.

Note: Text inside shadow DOM trees must also meet contrast requirements. In this example, the light gray text has a contrast ratio of 2.3:1 on a white background, which fails WCAG requirements.

Insufficient text contrast in shadow DOM 2.3:1:

This text is rendered inside a shadow DOM. Its color is light gray on a white background, resulting in insufficient contrast.


Note: Possible to implement because computed styles within open shadow DOMs can be accessed programmatically to check contrast ratios.

axe detected: 1.4.3  |  QualWeb detected: 1.4.3