Skip to content

Commit 7dc6e0d

Browse files
committed
[selectors-4] Add :open and :closed pseudo-classes #7319
1 parent 389fafd commit 7dc6e0d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

selectors-4/Overview.bs

+25
Original file line numberDiff line numberDiff line change
@@ -2481,6 +2481,29 @@ Sound State: the '':muted'' and '':volume-locked'' pseudo-classes</h3>
24812481
<h2 id="display-state-pseudos">
24822482
Element Display State Pseudo-classes</h2>
24832483

2484+
<h3 id="open-state">
2485+
Collapse State: the '':open'' and '':closed'' pseudo-class</h3>
2486+
2487+
The <dfn>:open</dfn> pseudo-class represents an element
2488+
that has both “open” and “closed” states,
2489+
and which is currently in the “open” state.
2490+
2491+
The <dfn>:closed</dfn> pseudo-class represents an element
2492+
that has both “open” and “closed” states,
2493+
and which is currently in the closed state.
2494+
2495+
Exactly what “open” and “closed” mean is host-language specific,
2496+
but exemplified by elements such as
2497+
HTML's <{details}>, <{select}>, and <{dialog}> elements,
2498+
all of which can be toggled “open” to display more content
2499+
(or any content at all, in the case of <{dialog}>).
2500+
2501+
Note: Being “open” or “closed” is a semantic state.
2502+
An element not currently being displayed
2503+
(for example, one that has ''visibility: collapse'',
2504+
or belongs to a ''display: none'' subtree)
2505+
can still be “open” and will match '':open''.
2506+
24842507
<h3 id="modal-state">
24852508
Modal (Exclusive Interaction) State: the '':modal'' pseudo-class</h3>
24862509

@@ -4007,6 +4030,8 @@ Changes since the 7 May 2022 Working Draft</h3>
40074030

40084031
Significant changes since the <a href="https://www.w3.org/TR/2022/WD-selectors-4-20220507/">7 May 2022 Working Draft</a>:
40094032

4033+
* Added '':open'' and '':closed'' pseudo-classes.
4034+
(<a href="https://github.com/w3c/csswg-drafts/issues/7319">Issue 7319</a>)
40104035
* Disallowed [=pseudo-elements=] from '':has()'' unless explicitly allowed
40114036
by the pseudo-element’s definition.
40124037
(<a href="https://github.com/w3c/csswg-drafts/issues/7463">Issue 7463</a>)

0 commit comments

Comments
 (0)