1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:38:10 +00:00

LibWeb: Implement the :open and :closed pseudo-classes

These apply to any elements that have some kind of open/closed state.
The spec suggests `<details>`, `<dialog>`, and `<select>`, so that's
what I've supported here. Only `<details>` is fleshed out right now,
but once the others are, these pseudo-classes should work
automatically. :^)
This commit is contained in:
Sam Atkins 2023-09-13 17:39:05 +01:00 committed by Andreas Kling
parent 29bb0f0ae6
commit 6bf107fc16
4 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<!doctype html>
<link rel="match" href="reference/css-open-closed-selectors-ref.html" />
<style>
:open {
color: green;
}
:closed {
color: red;
}
</style>
<details open>
<summary>Hi</summary>
Well hello friends!
</details>
<details>
<summary>Hi</summary>
Well hello friends!
</details>