diff --git a/README.md b/README.md index 86e5efd6..6d096800 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ Code examples that accompany various MDN DOM and Web API documentation pages. - The "document-picture-in-picture" directory contains an example showing usage of the [Document Picture-in-Picture API](http://developer.mozilla.org/docs/Web/API/Document_Picture-in-Picture_API/). [See the example live](https://mdn.github.io/dom-examples/document-picture-in-picture/). +- The "dynamic-range-limit" directory contains an example demonstrating the use of the [`dynamic-range-limit`](https://developer.mozilla.org/en-US/docs/Web/CSS/dynamic-range-limit) CSS property. See the [live demo](https://mdn.github.io/dom-examples/dynamic-range-limit). + - The "edit-context" directory contains examples demonstrating the [EditContext API](https://developer.mozilla.org/docs/Web/API/EditContext_API). See the [list of examples](https://github.com/mdn/dom-examples/tree/main/edit-context/). - The "file-system-api" directory contains multiple examples demonstrating usage of the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API): diff --git a/dynamic-range-limit/gioia-pixel-ultrahdr.jpg b/dynamic-range-limit/gioia-pixel-ultrahdr.jpg new file mode 100644 index 00000000..db321e9a Binary files /dev/null and b/dynamic-range-limit/gioia-pixel-ultrahdr.jpg differ diff --git a/dynamic-range-limit/index.html b/dynamic-range-limit/index.html new file mode 100644 index 00000000..805188da --- /dev/null +++ b/dynamic-range-limit/index.html @@ -0,0 +1,25 @@ + + + + + dynamic-range-limit property demo + + + + +

dynamic-range-limit property demo

+ +

+ Hover or tab to the image to see the difference in the brightness of the + white areas between the standard and + no-limit values of dynamic-range-limit. To see + the difference, you'll need to view the demo on a display that supports + the full brightness range of HDR content. +

+ + A subway station, with white strip lights lighting the platform and ad posters in the background + + diff --git a/dynamic-range-limit/style.css b/dynamic-range-limit/style.css new file mode 100644 index 00000000..b448fe9f --- /dev/null +++ b/dynamic-range-limit/style.css @@ -0,0 +1,16 @@ +body { + font: 1em / 1.4 sans-serif; +} + +img { + width: 50%; + border: 1px solid black; + dynamic-range-limit: standard; + transition: dynamic-range-limit 0.6s; +} + +img:hover, +img:focus { + dynamic-range-limit: no-limit; + /* dynamic-range-limit: dynamic-range-limit-mix(standard 70%, no-limit 30%); */ +}