Name | Summary |
---|---|
Detect if the user prefers a light or dark color scheme | |
Detects if the user has requested the system increase or decrease the amount of contrast between adjacent colors | |
The user prefers less motion on the page | |
The user prefers reduced transparency | |
Is the user agent or underlying OS inverting colors? |
prefers-color-scheme [light, dark]
@media (prefers-color-scheme: dark) {
body { background: #1e1e1e; color: white; }
}
prefers-contrast [high, low, forced, no-preference]
@media (prefers-contrast: high) {
:root {
--text-color: black;
}
}
prefers-reduced-motion [reduce, no-preference]
@media (prefers-reduced-motion) {
* { transition-duration: 0.05s; }
}
prefers-reduced-transparency [reduce, no-preference]
@media (prefers-reduced-transparency) {
.floating-box { opacity: 1; }
}
inverted-colors [inverted, none]
@media (inverted-colors: inverted) {
p {
background: black;
color: yellow;
}
}