Closed nuxodin closed 3 years ago
That makes sense, but I think color-scheme has to be specified on the :root
(https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme#adapting_to_color_schemes)
I've never seen it specified elsewhere, but I also have not tested otherwise.
And I think the specificity would not be an issue here because to change the value, a developer would need to specify it on :root
anyway, thus replacing the value.
Did some testing and it seems that color scheme CAN be defined on HTML, so this looks good.
Ok, specificity may not be a problem. This is a good answer on stackoverflow: https://stackoverflow.com/a/45387911/4865307
It makes sense if you don't want to exclude that your css is used in a document where html is not the root element. For example in a SVG document.
And that is just for color-scheme maybe still a use case...🤔
Oh, thats a great link. Thanks for sharing. I think targeting HTML should be fine. The case for SVG is something I really can't make any prediction on because I've never come across color-scheme for SVG. It's easy to change it back if needed, but until then, I like your solution here to keep things simpler.
:tada: This PR is included in version 1.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:root
is the same ashtml
But:root
has a higher specificity.See here: https://css-tricks.com/almanac/selectors/r/root/#points-of-interest