mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 22:05:19 +00:00
add aria-label and aria-pressed to toggle button for accessibility
This commit is contained in:
parent
0763d8e9b9
commit
343e41886f
1 changed files with 9 additions and 1 deletions
|
|
@ -298,7 +298,15 @@
|
||||||
>
|
>
|
||||||
<div class="flex-1 shrink-0">
|
<div class="flex-1 shrink-0">
|
||||||
<button
|
<button
|
||||||
class="px-3.5 py-1.5 text-sm font-medium bg-gray-50 hover:bg-gray-100 text-gray-900 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition rounded-lg shrink-0"
|
type="button"
|
||||||
|
class="px-3.5 py-1.5 text-sm font-medium bg-gray-50 hover:bg-gray-100 text-gray-900 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition rounded-lg shrink-0 {($settings?.highContrastMode ??
|
||||||
|
false)
|
||||||
|
? ''
|
||||||
|
: 'outline-hidden'}"
|
||||||
|
aria-pressed={role === 'assistant'}
|
||||||
|
aria-label={$i18n.t(
|
||||||
|
role === 'user' ? 'Switch to Assistant role' : 'Switch to User role'
|
||||||
|
)}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
role = role === 'user' ? 'assistant' : 'user';
|
role = role === 'user' ? 'assistant' : 'user';
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue