TiddlyWiki5/core/wiki/viewswitcher.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

17 lines
642 B
Text

title: $:/snippets/viewswitcher
\define icon()
$:/core/images/storyview-$(storyview)$
\end
\whitespace trim
\function view.filter() [<storyview>prefix{$:/view}]
<$linkcatcher to="$:/view">
<div class="tc-chooser tc-viewswitcher" role="listbox">
<$list filter="[storyviews[]]" variable="storyview">
<div class={{{ [view.filter[]then[tc-chooser-item tc-chosen]else[tc-chooser-item]] }}}>
<$button tag="a" class="tc-tiddlylink tc-btn-invisible" role="option" to=<<storyview>> aria-selected={{{ [view.filter[]then[true]else[false]] }}}><$transclude tiddler=<<icon>>/><$text text=<<storyview>>/></$button>
</div>
</$list>
</div>
</$linkcatcher>