Loading...
details.is-open summary {
font-weight: bold;
}details:is([open], :open) summary {
font-weight: bold;
}:is() forgives an unknown :open, so [open] still works as a fallback and no JavaScript class is needed.
:open to match popovers, which use :popover-open.:open or [open] instead of a class toggled by JavaScript.[open] fallback exists for <details> and <dialog> where :open is unsupported.[open] checks the HTML attribute, which only <details> and <dialog> have. :open also covers <select> and inputs with a picker, which have no such attribute.
Yes. Any open <dialog> matches :open, whether it was opened with show() or showModal(); only modal ones also match :modal.