[DevTools] Enable emulating CSS media features
This patch adds support for emulating CSS media features in general. For now, explicit presets are added for `prefers-color-scheme: light` (useful when the developer has enabled dark mode at the OS level) and `prefers-color-scheme: dark` (useful when the developer has enabled light mode at the OS level), as well as `prefers-reduced-motion: reduce`. The new UI is available in the Rendering drawer. The new settings are also accessible through the Command Menu. As Chrome implements support for additional CSS media features in the future, we can expand the current UI accordingly using the same mechanism introduced by this CL. CSS media features: https://drafts.csswg.org/mediaqueries-5/#mf-user-preferences Boring but useful demo/test page: https://mathiasbynens.be/demo/css-media Design doc: https://goo.gle/devtools-dark-mode Bug: chromium:1004246 Change-Id: I7dd067ea1659c6f27872c4f7a5464896618d1663 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832206Reviewed-by:Peter Marshall <petermarshall@chromium.org> Reviewed-by:
Yang Guo <yangguo@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org> Cr-Commit-Position: refs/heads/master@{#701688}
Showing
Please register or sign in to comment