@@ -2481,6 +2481,29 @@ Sound State: the '':muted'' and '':volume-locked'' pseudo-classes</h3>
2481
2481
<h2 id="display-state-pseudos">
2482
2482
Element Display State Pseudo-classes</h2>
2483
2483
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
+
2484
2507
<h3 id="modal-state">
2485
2508
Modal (Exclusive Interaction) State: the '':modal'' pseudo-class</h3>
2486
2509
@@ -4007,6 +4030,8 @@ Changes since the 7 May 2022 Working Draft</h3>
4007
4030
4008
4031
Significant changes since the <a href="https://www.w3.org/TR/2022/WD-selectors-4-20220507/">7 May 2022 Working Draft</a> :
4009
4032
4033
+ * Added '':open'' and '':closed'' pseudo-classes.
4034
+ (<a href="https://github.com/w3c/csswg-drafts/issues/7319">Issue 7319</a> )
4010
4035
* Disallowed [=pseudo-elements=] from '':has()'' unless explicitly allowed
4011
4036
by the pseudo-element’s definition.
4012
4037
(<a href="https://github.com/w3c/csswg-drafts/issues/7463">Issue 7463</a> )
0 commit comments