web: global data-focus-ring-hidden attribute

This commit is contained in:
wukko 2024-07-23 14:41:55 +06:00
parent 19ee8360c4
commit 23c9eb73aa
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
5 changed files with 22 additions and 21 deletions

View file

@ -6,7 +6,9 @@
<div id="placeholder-container" class="center-column-container"> <div id="placeholder-container" class="center-column-container">
<Meowbalt emotion="smile" /> <Meowbalt emotion="smile" />
<div data-first-focus tabindex="-1">{`${pageName} page is not ready yet!`}</div> <div tabindex="-1" data-first-focus data-focus-ring-hidden>
{`${pageName} page is not ready yet!`}
</div>
</div> </div>
<style> <style>

View file

@ -319,6 +319,10 @@
z-index: 1; z-index: 1;
} }
:global([data-focus-ring-hidden]:focus-visible) {
box-shadow: none !important;
}
:global(button:active, .button:active) { :global(button:active, .button:active) {
background-color: var(--button-hover); background-color: var(--button-hover);
} }
@ -366,18 +370,6 @@
margin-block: 0; margin-block: 0;
} }
:global(
h1:focus-visible,
h2:focus-visible,
h3:focus-visible,
h4:focus-visible,
h5:focus-visible,
h6:focus-visible,
main:focus-visible
) {
box-shadow: none !important;
}
:global(h1) { :global(h1) {
font-size: 24px; font-size: 24px;
letter-spacing: -1px; letter-spacing: -1px;

View file

@ -10,7 +10,12 @@
</svelte:head> </svelte:head>
<div id="cobalt-save-container" class="center-column-container"> <div id="cobalt-save-container" class="center-column-container">
<main id="cobalt-save" data-first-focus tabindex="-1"> <main
id="cobalt-save"
tabindex="-1"
data-first-focus
data-focus-ring-hidden
>
<Meowbalt emotion="smile" /> <Meowbalt emotion="smile" />
<Omnibox /> <Omnibox />
</main> </main>

View file

@ -67,8 +67,9 @@
<h3 <h3
id="settings-page-title" id="settings-page-title"
aria-level="1" aria-level="1"
data-first-focus
tabindex="-1" tabindex="-1"
data-first-focus
data-focus-ring-hidden
> >
{#if !isHome} {#if !isHome}
{$t(`settings.page.${currentPageTitle}`)} {$t(`settings.page.${currentPageTitle}`)}
@ -155,7 +156,12 @@
</div> </div>
{#if !isMobile || !isHome} {#if !isMobile || !isHome}
<main id="settings-page-content" data-first-focus tabindex="-1"> <main
id="settings-page-content"
tabindex="-1"
data-first-focus
data-focus-ring-hidden
>
<slot></slot> <slot></slot>
</main> </main>
{/if} {/if}

View file

@ -70,7 +70,7 @@
<svelte:window on:keydown={handleKeydown} /> <svelte:window on:keydown={handleKeydown} />
<div class="news" data-first-focus tabindex="-1"> <div class="news" tabindex="-1" data-first-focus data-focus-ring-hidden>
{#if changelog} {#if changelog}
<div id="left-button" class="button-wrapper-desktop"> <div id="left-button" class="button-wrapper-desktop">
{#if prev} {#if prev}
@ -135,10 +135,6 @@
justify-content: space-evenly; justify-content: space-evenly;
} }
.news:focus-visible {
box-shadow: none !important;
}
.button-wrapper-desktop { .button-wrapper-desktop {
display: flex; display: flex;
justify-content: center; justify-content: center;