46 lines
1.0 KiB
Plaintext
46 lines
1.0 KiB
Plaintext
Text should provide enough contrast with its background so that it can be read easily by people with moderately low vision, including colorblind people.
|
|
|
|
|
|
This rule raises an issue when a CSS selector defines both the ``++background-color++`` and ``++color++`` properties with a contrast ratio of less than 4.5:1, which is the contrast required to meet WCAG AA level. It applies only when the selector is not on a heading (``++h1++``, ``++h2++``,...) or ``++title++``
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,css]
|
|
----
|
|
body {
|
|
font-size: 17pt;
|
|
}
|
|
.myclass {
|
|
color: #777; // NonCompliant
|
|
background-color: #888;
|
|
}
|
|
|
|
.header h4 {
|
|
font-size: 22pt;
|
|
}
|
|
----
|
|
|
|
|
|
== See
|
|
|
|
* https://www.w3.org/TR/WCAG21/#contrast-minimum[WCAG2 - minimum contrast]
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
include::highlighting.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|