This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
Draft This page is not complete.
Note: This feature is not supported by any user agent and its specifics are subject to change.
The prefers-reduced-data
CSS media feature is used to detect if the user has requested the web content that consumes less internet traffic.
Syntax
no-preference
- Indicates that the user has made no preference known to the system. This keyword value evaluates as false in the boolean context.
reduce
- Indicates that user has expressed the preference for lightweight alternate content.
User preferences
Currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system.
Examples
Note: No browser currently implements this feature so the following example will not work.
In this example the montserrat-regular.woff2
font file will neither be preloaded nor downloaded if the user prefers reduced data, in this case the "system font stack" will serve as the fallback font:
HTML
<head>
<link rel="preload" href="fonts/montserrat-regular.woff2" as="font" media="(prefers-reduced-data: no-preference)" crossorigin>
<link rel="stylesheet" href="style.css">
</head>
CSS
@media (prefers-reduced-data: no-preference) {
@font-face {
font-family: Montserrat;
font-style: normal;
font-weight: 400;
font-display: swap;
/* latin */
src: local('Montserrat Regular'), local('Montserrat-Regular'), url('fonts/montserrat-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
}
body {
font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
Result
Specifications
Specification | Status | Comment |
---|---|---|
Media Queries Level 5The definition of 'reduced-data' in that specification. | Editor's Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome Full support 85 Full support 85 Notes' See bug 1051189.
Disabled' From version 85: this feature is behind the |
Edge Full support 85 Full support 85 Notes' See bug 1051189.
Disabled' From version 85: this feature is behind the |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android No support No No support No Notes' See bug 1051189. |
Chrome Android Full support 85 Full support 85 Notes' See bug 1051189.
Disabled' From version 85: this feature is behind the |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
No support No |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- See implementation notes.'
- See implementation notes.
- User must explicitly enable this feature.'
- User must explicitly enable this feature.
See also
Save-Data
HTTP header
prefers-reduced-data by Mozilla Contributors is licensed under CC-BY-SA 2.5.