@@ -605,16 +605,30 @@ Default UA Styles
605
605
:root::grammar-error { text-decoration-line: grammar-error; }
606
606
607
607
608
- For ''::selection'' and ''::target-text'' ,
609
- the recommended default styling is to use [=highlight colors=] .
610
-
611
608
Note: the “paired cascade” behavior of [=highlight colors=]
612
609
means that UA defaults for these colors
613
610
can't be expressed in terms of 'color' and 'background-color'
614
611
in [=UA style sheet=] rules.
615
612
However it has been interoperably implemented in browsers
616
613
and is thus probably a Web-compatibility requirement.
617
614
615
+ UAs may define default highlight colors
616
+ for each highlight pseudo-element,
617
+ consisting of a 'color' and a 'background-color' ,
618
+ and doing so is recommended
619
+ for ''::selection'' and ''::target-text'' .
620
+ Otherwise,
621
+ the default highlight colors for that highlight must be
622
+ 'currentColor' ( not 'initial' or 'inherit' )
623
+ and 'transparent' respectively.
624
+
625
+ Note: In other words,
626
+ when the UA doesn’t define default highlight colors
627
+ for a given highlight,
628
+ highlighted content retains the 'color'
629
+ that would otherwise have been used
630
+ without that highlight.
631
+
618
632
UAs may apply additional effects to enhance the presentation
619
633
of highlighted content,
620
634
for example dimming content other than the highlighted text
0 commit comments