prefers-contrast
The CSS media feature that reports whether the user has asked their operating system for more or less contrast.
In more detail
@media (prefers-contrast: more) lets a design system switch to a high-contrast theme with stronger borders and text. The lesson checks it before the colour-scheme preference, so accessibility needs win.
Related terms
- forced colors mode — A browser mode, turned on by settings such as Windows Contrast Themes, that replaces a page's colours with a small palette the user chose.
- high-contrast theme — A theme with maximum difference between text, borders and backgrounds for people with low vision.
- media query — A CSS rule, written @media, that applies styles only when a condition about the device or user settings is true.
Taught in
- Dark Mode Strategies: System Preference, Class & High-Contrast — Design Systems & Component Engineering