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:
parent
29bb0f0ae6
commit
6bf107fc16
4 changed files with 64 additions and 0 deletions
18
Tests/LibWeb/Ref/css-open-closed-selectors.html
Normal file
18
Tests/LibWeb/Ref/css-open-closed-selectors.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue