TiddlyWiki5/core/wiki/themeswitcher.tid
XLBilly 19177964c8
Improve switcher (UI) accessibility (#9347)
* Improve theme switcher accessibility

* Improve view switcher accessibility

* Replace set widgets with filters

* Improve languageswitcher & layoutswitcher accessibility

* Add indentation inside list widget

* Switch to functions
2025-11-01 13:06:19 +00:00

18 lines
No EOL
661 B
Text

title: $:/snippets/themeswitcher
\whitespace trim
\function theme.filter() [all[current]field:title{$:/theme}] [[$:/theme]!has[text]addsuffix[s/tiddlywiki/vanilla]field:title<currentTiddler>] +[limit[1]]
<$linkcatcher to="$:/theme">
<div class="tc-chooser" role="listbox">
<$list filter="[plugin-type[theme]sort[title]]">
<div class={{{ [theme.filter[]then[tc-chooser-item tc-chosen]else[tc-chooser-item]] }}}>
<$link to={{!!title}} role="option" aria-selected={{{ [theme.filter[]then[true]else[false]] }}}>
''<$view field="name" format="text"/>''
&#32;
<$view field="description" format="text"/>
</$link>
</div>
</$list>
</div>
</$linkcatcher>