Skip to content

Latest commit

 

History

History
66 lines (55 loc) · 906 Bytes

media-prefers-color-scheme.md

File metadata and controls

66 lines (55 loc) · 906 Bytes

Pattern: Missing use of prefers-color-scheme

Issue: -

Description

Require implementation of certain styles for selectors with colors.

Examples

The following pattern are considered violations:

.foo {
  color: red;
}
.bar {
  color: red;
}
.baz {
  background-color: red;
}
@media screen and (prefers-color-scheme: dark) {
  .baz {
    background-color: white;
  }
}
.foo {
  color: red;
}
@media screen and (prefers-color-scheme: dark) {
  .foo {
    background-color: red;
  }
}

The following patterns are not considered violations:

.foo {
  color: red;
}
@media screen and (prefers-color-scheme: dark) {
  .foo {
    color: white;
  }
}
.bar {
  background-color: white;
}
@media screen and (prefers-color-scheme: dark) {
  .bar {
    background-color: gray;
  }
}