This is an accessibility faux-pas, so we should do this with some javascript instead.
Don't use \<details\> tag for collapsible sections #40
Did you try this out? It is a little unusual 😉
- The headers are a little crazy
- The collapsing doesn't work at all. Everything is always expanded and there is no way to collapse anything.
Keep in mind, too, that we'll need to change the CSS and we need to do it in a way that doesn't impact the XML theme, so now is a good time to split the stylesheets I think.
I forgot to track the changes to the stylesheet lmao. I'll split the stylesheet as you suggest.
Another change I forgot to track 🤦♂️. Fixed now: https://tangled.org/jonmsterling.com/ocaml-forester/commit/d2c229903065576b4f5be01c1e6783cb1b2dc0da
OK, it's working now !!! Thanks so much 😃
There's just one minor tweak I might like to make. Currently the section>header has display:inline, which means that you have to literally click the text to toggle the state, vs. being able to do so by clicking anywhere in it. I think maybe it might be a good idea to have it be displayed as a block. What do you think?
I'm with you on this. Ideally the structure of a section could be something like
and the expanding/collapsing behaviour would be handled by JavaScript, possibly by dynamically setting and unsetting a
collapsedclass of thesection>div.bodyelement. The CSS would just hide anything that iscollapsed.I think this would result in pretty graceful behaviour for non-JS-enabled viewers: when the transclusion is set to be collapsed by default (using
\tranclude/expanded), in the absence of JS it would just be not expandable at all, which is (to me) a perfectly acceptable behaviour.