Skip to content

Commit

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

1. w3c#9879 (comment)

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

3. w3c#9879 (comment)

and uses the definition added in w3c#10083.
  • Loading branch information
dbaron committed May 28, 2024
1 parent 6b3a79f commit 35d5298
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 @@ -1280,6 +1280,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 35d5298

Please sign in to comment.