focusのデザイン修正

This commit is contained in:
kakkokari-gtyih 2024-07-09 19:13:37 +09:00
parent d8cf64a2ca
commit aaf02d575f
2 changed files with 75 additions and 5 deletions

View File

@ -10,15 +10,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="items">
<template v-for="(item, i) in group.items">
<a v-if="item.type === 'a'" :href="item.href" :target="item.target" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }">
<a v-if="item.type === 'a'" :href="item.href" :target="item.target" class="_button item" :class="{ danger: item.danger, active: item.active }">
<span v-if="item.icon" class="icon"><i :class="item.icon" class="ti-fw"></i></span>
<span class="text">{{ item.text }}</span>
</a>
<button v-else-if="item.type === 'button'" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="ev => item.action(ev)">
<button v-else-if="item.type === 'button'" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="ev => item.action(ev)">
<span v-if="item.icon" class="icon"><i :class="item.icon" class="ti-fw"></i></span>
<span class="text">{{ item.text }}</span>
</button>
<MkA v-else :to="item.to" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }">
<MkA v-else :to="item.to" class="_button item" :class="{ danger: item.danger, active: item.active }">
<span v-if="item.icon" class="icon"><i :class="item.icon" class="ti-fw"></i></span>
<span class="text">{{ item.text }}</span>
</MkA>

View File

@ -166,6 +166,15 @@ function more(ev: MouseEvent) {
display: block;
text-align: center;
width: 100%;
&:focus-visible {
outline: none;
> .instanceIcon {
outline: 2px solid var(--focus);
outline-offset: 2px;
}
}
}
.instanceIcon {
@ -207,6 +216,15 @@ function more(ev: MouseEvent) {
background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB));
}
&:focus-visible {
outline: none;
&:before {
outline: 2px solid var(--fgOnAccent);
outline-offset: -4px;
}
}
&:hover, &.active {
&:before {
background: var(--accentLighten);
@ -234,6 +252,14 @@ function more(ev: MouseEvent) {
text-align: left;
box-sizing: border-box;
overflow: clip;
&:focus-visible {
outline: none;
> .avatar {
box-shadow: 0 0 0 4px var(--focus);
}
}
}
.avatar {
@ -282,7 +308,16 @@ function more(ev: MouseEvent) {
color: var(--navActive);
}
&:hover, &.active {
&:focus-visible {
outline: none;
&:before {
outline: 2px solid var(--focus);
outline-offset: -2px;
}
}
&:hover, &.active, &:focus {
color: var(--accent);
&:before {
@ -352,6 +387,15 @@ function more(ev: MouseEvent) {
display: block;
text-align: center;
width: 100%;
&:focus-visible {
outline: none;
> .instanceIcon {
outline: 2px solid var(--focus);
outline-offset: 2px;
}
}
}
.instanceIcon {
@ -391,6 +435,15 @@ function more(ev: MouseEvent) {
background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB));
}
&:focus-visible {
outline: none;
&:before {
outline: 2px solid var(--fgOnAccent);
outline-offset: -4px;
}
}
&:hover, &.active {
&:before {
background: var(--accentLighten);
@ -413,6 +466,14 @@ function more(ev: MouseEvent) {
padding: 20px 0;
width: 100%;
overflow: clip;
&:focus-visible {
outline: none;
> .avatar {
box-shadow: 0 0 0 4px var(--focus);
}
}
}
.avatar {
@ -442,7 +503,16 @@ function more(ev: MouseEvent) {
width: 100%;
text-align: center;
&:hover, &.active {
&:focus-visible {
outline: none;
&:before {
outline: 2px solid var(--focus);
outline-offset: -2px;
}
}
&:hover, &.active, &:focus {
text-decoration: none;
color: var(--accent);