← Back to release summary

HDR CSS Media Queries: dynamic-range

Category
Multimedia
Type
Chromium catches up
Status
Enabled by default (Chrome 98)
Intent stage
None

Summary

Adds a media query to CSS which allows a page to detect the current display device’s support for HDR. This feature adds the query: 'dynamic-range' which may be one of 'standard' or 'high'. Chrome will resolve this query according to the capabilities of the display device the browser window is currently positioned on, allowing pages to toggle CSS rules accordingly or respond in Javascript via 'window.matchMedia()'.

Motivation

As HDR-supported displays become more common, web developers need ways to enable HDR content on their web pages without compromising the experience for users of non-HDR displays, or mixed-HDR multi-display setups. CSS already provides the 'media query' concept for toggling rules based on display device characteristics, and this feature extends that set of queries to enable detecting HDR support on the current display device.

Standards & signals

Samples: https://willcassella.github.io/blink-hdr/demos/css-dynamic-range.html

Explainers: https://www.w3.org/TR/mediaqueries-5/#dynamic-range

View on chromestatus.com