4 ms·
html5's summary/detail works without javascript, can be controlled via attributes and remains interactive with JS disabled. Maybe with some creative CSS it coul
by the8472 6y ago
html5's summary/detail works without javascript, can be controlled via attributes and remains interactive with JS disabled. Maybe with some creative CSS it could be somehow wrangled into the [-]?
- smichel17 6y agoSummary/details are very difficult to style. You can approximate it using some hackery with a checkbox and sibling selectors. Here's an example that I was working on recently: https://smichel17.gitlab.io/donate https://smichel17.gitlab.io/donate Source is here: https://gitlab.com/smichel17/smichel17.gitlab.io/-/blob/master/assets/css/page/donate.sass#L83-100 https://gitlab.com/smichel17/smichel17.gitlab.io/-/blob/mast... Note: accessibility is still WIP, because the toggle is not selectable with the keyboard. Should be solve-able though by hiding the checkbox via different means than `display: hidden` (ie, so the checkbox is visually hidden but still keyboard-selectable).