Skip to content

Commit

Permalink
Add ::details-content pseudo-element. (#10379)
Browse files Browse the repository at this point in the history
This adds the ::details-content pseudo-element as resolved in:

1. #9879 (comment)

2. whatwg/html#10200 (comment) /
   #9951 (comment)

3. #9879 (comment)

and uses the definition added in #10083.
  • Loading branch information
dbaron committed May 30, 2024
1 parent 0f41712 commit 3715f00
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,33 @@ File Selector Button: the ''::file-selector-button'' pseudo-element</h3>
<pre class="lang-css">::file-selector-button { border: 3px solid green }</pre>
</div>

<h3 id="details-content-pseudo">
Expandable contents of details element: the ''::details-content'' pseudo-element</h3>

The <dfn>::details-content</dfn> pseudo-element targets
the additional information in a a <{details}> element
that can be expanded or collapsed.
It is a [=part-like pseudo-element=].

There is no restriction on which properties apply to the
''::details-content'' pseudo-element.

<div class="example" id="details-content-example">
For example, the following example would
animate the opacity of the additional information
when the <{details}> element opens:

<pre class="lang-css">details::details-content {
opacity: 0;
transition: content-visibility 300ms allow-discrete step-end, opacity 300ms;
}

details[open]::details-content {
opacity: 1;
transition: content-visibility 300ms allow-discrete step-start, opacity 300ms;
}</pre>
</div>

<h2 id="interactions">
Overlapping Pseudo-element Interactions</h2>

Expand Down

0 comments on commit 3715f00

Please sign in to comment.