User preference media features give you the ability to style web experiences that align with the user’s own specific preferences and needs. In other words, preference media features allow you to adapt your user experiences to your user’s expectations.
You can enhance the user experience of your website by taking the following three steps:
- Discover the possibilities. Learn all the user preference media features.
- Style your web experiences. Implement, for example, color, layout, and element size changes based on the preferences.
- Test the UI. In DevTools, emulate the preferences and test how your website behaves.
DevTools supports a variety of emulation options. To help you avoid searching for and adjusting system and browser settings, all the emulation options reside in one place—under the Rendering tab in DevTools.
The emulation options of the user’s preferences include but are not limited to:
prefers-color scheme
—light or dark color schemeprefers-contrast
—lower or higher contrastprefers-reduced-motion
—minimize motion or notprefers-reduced-data
—consume less traffic or not
For a comprehensive list of all emulation options, see Emulate CSS media features.
To discover more effects you can apply using the Rendering tab, see the Rendering tab overview.
Additionally, with DevTools, your testing capabilities aren’t limited to the single device you’re working on. You can Simulate mobile devices with Device Mode.
This post is also available in: English