Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ if ("virtualKeyboard" in navigator) {
}
```

For styles, you can also do feature detection in CSS using the [`@supports`](/en-US/docs/Web/CSS/Reference/At-rules/@supports) at-rule, combined with the `not` keyword if you want to check for the absence of a feature.
For styles, you can also do feature detection in CSS using the {{cssxref("@supports")}} at-rule, combined with the `not` keyword if you want to check for the absence of a feature.
See [Using feature queries](/en-US/docs/Web/CSS/Guides/Conditional_rules/Using_feature_queries) for information on using this in CSS.

```css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Content-Type: image/jpeg

## See also

- CSS `@media` feature [`prefers-reduced-data`](/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-data) {{experimental_inline}}
- CSS `@media` feature {{cssxref("@media/prefers-reduced-data")}} {{experimental_inline}}
- {{HTTPHeader("Vary")}} header which indicates that the content served varies depending on the value of `Save-Data` (see [HTTP Caching: Vary](/en-US/docs/Web/HTTP/Guides/Caching#vary))
- {{domxref("NetworkInformation.saveData")}}
- [Help Your Users `Save-Data`](https://css-tricks.com/help-users-save-data/) on css-tricks.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This header is modeled on the {{cssxref("@media/prefers-color-scheme", "prefers-

The **`Sec-CH-Prefers-Color-Scheme`** header allows sites to obtain user color scheme preference at request time; they could then choose to provide the relevant CSS for the user's preference inline, for performance reasons. If the server inlines the CSS, it might want to include a {{HTTPHeader("Vary")}} response header specifying `Sec-CH-Prefers-Color-Scheme`, to indicate that the response is tailored for a particular color scheme.

If performance is not a critical consideration in this context, you could instead handle the user's color scheme preference using the [`prefers-color-scheme`](/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme) media query, and/or the {{domxref("Window.matchMedia()")}} API.
If performance is not a critical consideration in this context, you could instead handle the user's color scheme preference using the {{cssxref("@media/prefers-color-scheme")}} media query, and/or the {{domxref("Window.matchMedia()")}} API.

`Sec-CH-Prefers-Color-Scheme` is a high entropy hint so the site needs to opt into receiving it by sending an appropriate {{HTTPHeader("Accept-CH")}} response header. A user agent may intentionally omit the `Sec-CH-Prefers-Color-Scheme` header to preserve user privacy since the user's preference could, in theory, be used for fingerprinting.

Expand Down Expand Up @@ -103,5 +103,5 @@ The client will include the header in subsequent requests in the current session
- [User-Agent Client Hints API](/en-US/docs/Web/API/User-Agent_Client_Hints_API)
- {{HTTPHeader("Accept-CH")}}
- [HTTP Caching varying responses](/en-US/docs/Web/HTTP/Guides/Caching#vary) and {{HTTPHeader("Vary")}} header
- [`prefers-color-scheme` CSS Media Query](/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)
- {{cssxref("@media/prefers-color-scheme")}} CSS media query
- [Improving user privacy and developer experience with User-Agent Client Hints](https://developer.chrome.com/docs/privacy-security/user-agent-client-hints) (developer.chrome.com)
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ The client will include the header in subsequent requests in the current session
- [Client hints](/en-US/docs/Web/HTTP/Guides/Client_hints)
- [User-Agent Client Hints API](/en-US/docs/Web/API/User-Agent_Client_Hints_API)
- {{HTTPHeader("Accept-CH")}}
- [`prefers-reduced-motion` CSS Media Query](/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion)
- {{cssxref("@media/prefers-reduced-motion")}} CSS media query
- [HTTP Caching: Vary](/en-US/docs/Web/HTTP/Guides/Caching#vary) and {{HTTPHeader("Vary")}} header
- [Improving user privacy and developer experience with User-Agent Client Hints](https://developer.chrome.com/docs/privacy-security/user-agent-client-hints) (developer.chrome.com)