1
0
mirror of https://github.com/sakofchit/system.css.git synced 2026-05-05 06:01:22 +09:00

Rework dropdown menus as <details>/<summary>

the hidden checkbox approach is brittle and not accessible (wrapping the entire checkbox and menu inside a `<label>`, not easy to add `:focus` style, etc)
This commit is contained in:
Patrick H. Lauke
2022-08-12 20:45:08 +01:00
parent 29ff21628e
commit 20ecb5e17b
2 changed files with 18 additions and 33 deletions

View File

@@ -563,6 +563,7 @@ form {
height: 0;
}
.dd-toggle:focus,
.dd-toggle:hover {
background-color: black;
color: white;
@@ -581,14 +582,6 @@ form {
font-size: 1em;
}
.dd-input + .dd-menu {
display: none;
}
.dd-input:checked + .dd-menu {
display: block;
}
.dd-menu li {
padding: 5px 20px;
cursor: pointer;