Short answer: I don’t know.
Longer answer…
You’re heading off into the realms of I-don’t-know-where (that’s why I didn’t add your css to my 0.2). I prefer to stick with something really simple and wait for @jeremyruston’s intrinsic support to appear.
Having said that, I’m tinkering with a \widget
+ <$genesis>
combo, just for kicks.
Currently looking like this…
<!--$ $.ce
@param tag <string> The tag to hold the `text` parameter.
@param id <string> Becomes the `data-id` attribute that uniquely identifies this widget.
@param text <string> The text to be inserted in the element identified by `tag`.
@comments Provides a collapsible-expandable element (akin to the HTML details element).
$-->
\widget $.ce(tag, id, text)
<$eventcatcher selector=<<tag>> $click=<<$.ce-actions>> tag=div class="ce-catcher">
<$genesis $type=<<tag>> data-id=<<id>>> <<text>> </$genesis>
<$slot $name="ts-raw"/>
</$eventcatcher>
\end $.ce
\procedure $.ce-actions()
<!-- <<alog $.ce-actions "dom-data-id dom-keep-open">> -->
<% if [<dom-keep-open>!match[true]] %>
<$action-setfield $field=selected-header $value=<<dom-data-id>> />
<% endif %>
\end
Strangely, in use, it makes the wikitext look more cumbersome…
<$.ce tag="h1" id="mercury" text="About Mercury">
<div>
Mercury is extremely hot and extremely cold.
</div>
</$.ce>
That’s a lot of technical debt (and repeated use of $eventcatcher
) for such ungainly looking wikitext at the point it is used. See my point? I’ll wait for Jeremy.