I know that :root
can be used to select html
tag for HTML file and to select svg
tag for svg
file (regarding styling XML files this is something really strange and not applicable for me), but I don't see sense to prefer :root
over html
or svg
selectors. Applying the same styles for HTML and SVG seem really odd for me using :root
. I am sure that this is not realistic scenario.
The only valid application of :root
I found that it can be used to override html
styles (because pseudoclass selector has more priority than type selector), but I would avoid often overriding of html
and place specific CSS file links later in order to avoid this need.
So the question: are there any real world application of :root
where it wouldn't be just an odd alternative to html
(or svg
for SVG file)?