fix(color): indicate [autofocus] on interactive elements when not using the keyboard
This commit is contained in:
parent
36ebc93df8
commit
fe6647e0fb
|
@ -75,6 +75,7 @@ onMounted(() => {
|
||||||
align(props, { alignSelf:'start', alignText:'center' })(
|
align(props, { alignSelf:'start', alignText:'center' })(
|
||||||
)))}"
|
)))}"
|
||||||
class="funkwhale button split-main"
|
class="funkwhale button split-main"
|
||||||
|
:autofocus="autofocus || undefined"
|
||||||
:disabled="disabled || undefined"
|
:disabled="disabled || undefined"
|
||||||
:aria-pressed="props.ariaPressed"
|
:aria-pressed="props.ariaPressed"
|
||||||
:class="{
|
:class="{
|
||||||
|
@ -106,6 +107,7 @@ onMounted(() => {
|
||||||
align(props, { alignSelf:'start', alignText:'center' })(
|
align(props, { alignSelf:'start', alignText:'center' })(
|
||||||
)))}"
|
)))}"
|
||||||
:disabled="disabled || undefined"
|
:disabled="disabled || undefined"
|
||||||
|
:autofocus="autofocus || undefined"
|
||||||
:class="[
|
:class="[
|
||||||
'funkwhale',
|
'funkwhale',
|
||||||
'button',
|
'button',
|
||||||
|
@ -132,6 +134,7 @@ onMounted(() => {
|
||||||
align(props, { alignSelf:'start', alignText:'center' })(
|
align(props, { alignSelf:'start', alignText:'center' })(
|
||||||
)))"
|
)))"
|
||||||
:disabled="disabled || undefined"
|
:disabled="disabled || undefined"
|
||||||
|
:autofocus="autofocus || undefined"
|
||||||
class="funkwhale button"
|
class="funkwhale button"
|
||||||
:aria-pressed="props.ariaPressed"
|
:aria-pressed="props.ariaPressed"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
|
@ -65,6 +65,7 @@ const model = defineModel<string|number>({ required: true })
|
||||||
v-bind="{...$attrs, ...attributes, ...color(props, ['solid', 'default', 'secondary'])()}"
|
v-bind="{...$attrs, ...attributes, ...color(props, ['solid', 'default', 'secondary'])()}"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
ref="input"
|
ref="input"
|
||||||
|
:autofocus="autofocus || undefined"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@click.stop
|
@click.stop
|
||||||
@blur="showPassword = false"
|
@blur="showPassword = false"
|
||||||
|
|
|
@ -44,6 +44,7 @@ onMounted(() => {
|
||||||
align(props)(
|
align(props)(
|
||||||
)))"
|
)))"
|
||||||
ref="button"
|
ref="button"
|
||||||
|
:autofocus="autofocus || undefined"
|
||||||
:class="[
|
:class="[
|
||||||
$style.link,
|
$style.link,
|
||||||
round && $style['is-round'],
|
round && $style['is-round'],
|
||||||
|
|
|
@ -86,7 +86,7 @@ onKeyboardShortcut('escape', () => isOpen.value = false)
|
||||||
{{ cancel }}
|
{{ cancel }}
|
||||||
</Button>
|
</Button>
|
||||||
</Layout>
|
</Layout>
|
||||||
<Spacer size-48 v-else />
|
<Spacer size-46 v-else />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
|
@ -67,7 +67,9 @@ onMounted(() => {
|
||||||
<input ref="input" type="range"
|
<input ref="input" type="range"
|
||||||
style="width: var(--slider-width); opacity: .001;"
|
style="width: var(--slider-width); opacity: .001;"
|
||||||
:max="keys.length - 1"
|
:max="keys.length - 1"
|
||||||
v-model="index" />
|
:autofocus="autofocus || undefined"
|
||||||
|
v-model="index"
|
||||||
|
/>
|
||||||
<div :class="$style.range" />
|
<div :class="$style.range" />
|
||||||
<div :class="$style.pin" />
|
<div :class="$style.pin" />
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -206,6 +206,7 @@ onMounted(() => {
|
||||||
@keydown.ctrl.b.exact.prevent="bold" @keydown.ctrl.i.exact.prevent="italics"
|
@keydown.ctrl.b.exact.prevent="bold" @keydown.ctrl.i.exact.prevent="italics"
|
||||||
@keydown.ctrl.shift.x.exact.prevent="strikethrough" @keydown.ctrl.k.exact.prevent="link" :maxlength="charLimit"
|
@keydown.ctrl.shift.x.exact.prevent="strikethrough" @keydown.ctrl.k.exact.prevent="link" :maxlength="charLimit"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
|
:autofocus="autofocus || undefined"
|
||||||
:required="required"
|
:required="required"
|
||||||
:placeholder="placeholder" v-model="model" id="textarea_id" :rows="initialLines"
|
:placeholder="placeholder" v-model="model" id="textarea_id" :rows="initialLines"
|
||||||
:style="`min-height:${((typeof(initialLines) === 'string' ? parseInt(initialLines) : (initialLines ?? 3)) + 1.2) * 1.5}rem`"
|
:style="`min-height:${((typeof(initialLines) === 'string' ? parseInt(initialLines) : (initialLines ?? 3)) + 1.2) * 1.5}rem`"
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
// (2) Choosing the semantic colors from the palette
|
// (2) Choosing the semantic colors from the palette
|
||||||
|
|
||||||
* {
|
* {
|
||||||
--focus-background-color: color-mix(in oklab, var(--focus-ring-color) 20%, var(--background-color));
|
--autofocus-outline-color: color-mix(in oklab, var(--background-color) 80%, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Light theme
|
// Light theme
|
||||||
|
@ -528,10 +528,11 @@
|
||||||
background-color: var(--pressed-background-color, var(--active-background-color));
|
background-color: var(--pressed-background-color, var(--active-background-color));
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIndicate autofocus when using a mouse
|
// Indicate autofocus when using a mouse
|
||||||
|
|
||||||
:focus:not(:focus-visible) {
|
[autofocus]:focus:not(:focus-visible) {
|
||||||
background-color: var(--focus-background-color);
|
outline: 4px solid var(--autofocus-outline-color);
|
||||||
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback for decorative elements without explicit color props
|
// Fallback for decorative elements without explicit color props
|
||||||
|
|
Loading…
Reference in New Issue