Skip to content

Latest commit

 

History

History
72 lines (60 loc) · 1.14 KB

File metadata and controls

72 lines (60 loc) · 1.14 KB

media-prefers-color-scheme

Require implementation of certain styles for selectors with colors.

Sources:

Options

true

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;
  }
}