Skip to content

Commit 845ca6a

Browse files
committed
[css-pseudo-4] Add a note about applying box-decorating styles on ::details-content. #12845
1 parent 40b0de7 commit 845ca6a

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

css-pseudo-4/Overview.bs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,16 +1666,25 @@ Expandable contents of details element: the ''::details-content'' pseudo-element
16661666
when the <{details}> element opens:
16671667

16681668
<pre class="lang-css">
1669-
details::details-content {
1670-
opacity: 0;
1671-
transition: content-visibility 300ms allow-discrete, opacity 300ms;
1672-
}
1673-
1674-
details[open]::details-content {
1675-
opacity: 1;
1676-
}</pre>
1669+
details::details-content {
1670+
opacity: 0;
1671+
transition: content-visibility 300ms allow-discrete, opacity 300ms;
1672+
}
1673+
1674+
details[open]::details-content {
1675+
opacity: 1;
1676+
}</pre>
16771677
</div>
16781678

1679+
Note: The default UA stylesheet styles a closed ''::details-content''
1680+
with ''content-visibility: hidden'',
1681+
so the contents are still considered present for the purpose of find-in-page
1682+
and similar features.
1683+
This, however, only suppresses the display of the pseudo-elements's <em>contents</em>;
1684+
if margin, borders, etc are set on the pseudo-element, they'll still be visible.
1685+
Use ''[open]::details-content'' to apply these styles if that's undesirable.
1686+
1687+
16791688
<h2 id="interactions">
16801689
Overlapping Pseudo-element Interactions</h2>
16811690

0 commit comments

Comments
 (0)