squizlabs / HTML_CodeSniffer

HTML_CodeSniffer is a client-side JavaScript application that checks a HTML document or source code, and detects violations of a defined coding standard. Comes with standards that cover the three conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.0 and the U.S. Section 508 legislation.
https://squizlabs.github.io/HTML_CodeSniffer/
BSD 3-Clause "New" or "Revised" License
1.12k stars 246 forks source link

Support for "prefers-color-scheme" #278

Open alexiscott opened 4 years ago

alexiscott commented 4 years ago

HTML code sniffer, which is what PA11y uses for these rules, does not appear to support the CSS @media rule: @media (prefers-color-scheme: dark) {}

More details here: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

This means that when pally-ci runs it's tests, it does not see the any non-compliant CSS. An example might be:


<style>
 @media (prefers-color-scheme: dark) {
   .prefers {
     background: black;
     color: black;
   }
 }
</style>

<div class="prefers">
  I "prefer" a black background, and black text, that nobody can read!
</div>

Is this a feature that will be added to pa11y?