From 23911cbc9253ef453e297e71a511371084621b4b Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 24 Jun 2024 23:22:19 +0600 Subject: [PATCH] web: global focus-visible --- web/src/components/sidebar/SidebarTab.svelte | 11 ----------- web/src/routes/+layout.svelte | 9 ++++++++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/web/src/components/sidebar/SidebarTab.svelte b/web/src/components/sidebar/SidebarTab.svelte index ff587dde..089214a2 100644 --- a/web/src/components/sidebar/SidebarTab.svelte +++ b/web/src/components/sidebar/SidebarTab.svelte @@ -65,17 +65,6 @@ opacity: 1; } - .sidebar-tab:focus-visible { - box-shadow: 0 0 0 3px var(--blue) inset; - outline: none; - z-index: 1; - } - - .sidebar-tab.active:focus-visible { - background: var(--blue); - color: var(--sidebar-highlight); - } - @media (hover: hover) { .sidebar-tab:hover { opacity: 1; diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte index 931c283f..42421512 100644 --- a/web/src/routes/+layout.svelte +++ b/web/src/routes/+layout.svelte @@ -129,7 +129,7 @@ box-shadow: 0 0 0 1.5px var(--button-stroke) inset; } - :global(button:focus-visible) { + :global(:focus-visible) { box-shadow: 0 0 0 2px var(--blue) inset; outline: none; z-index: 1; @@ -144,6 +144,13 @@ color: var(--primary); } + /* important is used because active class is toggled by state */ + /* and added to the end of the list, taking priority */ + :global(.active:focus-visible) { + background: var(--blue) !important; + color: var(--sidebar-highlight) !important; + } + @media (hover: hover) { :global(button:hover) { background-color: var(--button-hover);