This repository was archived by the owner on Aug 31, 2023. It is now read-only.
website(docs): set color-scheme
on the root element
#3721
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
color-scheme
was previously set oninput
s only, while we can set it on the root/html element to affect other elements on the page, including scrollbars.I've also added the
only
keyword to prevent user agents from applying color overrides.I've also changed from the
html
selector to:root
, shouldn't matter much, though I do wonder if browsers optimize it as there can only be one:root
per document, while you are allowed to create randomhtml
elements and append them just about anywhere.For reference:
https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
https://developer.mozilla.org/en-US/docs/Web/CSS/:root
Before
After
Test Plan
Tested in the live website with Chrome's DevTools.
Double-checked with the deploy preview.