Skip to content

Commit cffb1ac

Browse files
committed
refactor(web): make all button and input focus:outline-none by default
1 parent 28b3696 commit cffb1ac

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

web/src/assets/base.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ html {
55
font-size: 16px;
66
}
77

8+
button, input {
9+
&:focus {
10+
@apply outline-none;
11+
}
12+
}
13+
814
svg {
915
@apply fill-current;
1016
}
@@ -23,7 +29,6 @@ svg {
2329
@apply w-page px-0 mx-auto;
2430
}
2531
}
26-
2732
/*! purgecss end ignore */
2833

2934
@tailwind utilities;

web/src/components/AppMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="h-full relative" :data-prevent-clickaway="visible">
3-
<button class="h-full w-header -mr-offset relative z-10 focus:outline-none flex" @click="visible = !visible">
3+
<button class="h-full w-header -mr-offset relative z-10 flex" @click="visible = !visible">
44
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="m-auto w-6 h-6">
55
<transition
66
enter-class="translate-y-full"

web/src/components/PlayerAdvancementPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<header class="border-b border-gray-300 bg-gray-100 md:rounded-t-md flex flex-col">
44
<div class="px-page xl:px-5 flex items-center">
55
<h2 class="py-3 xl:py-4 text-cool-gray-700 text-lg xl:text-xl font-medium uppercase tracking-wide">{{ t('nyaa.player_advancements.section_title') }}</h2>
6-
<button class="ml-auto p-1 -mr-1 focus:outline-none flex" @click="showConfig = !showConfig">
6+
<button class="ml-auto p-1 -mr-1 flex" @click="showConfig = !showConfig">
77
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" :class="['w-6 h-6', showConfig ? 'fill-black' : 'fill-gray-500']">
88
<path d="M8 7a5 5 0 1 0 0 10h8a5 5 0 0 0 0-10H8zm0-2h8a7 7 0 0 1 0 14H8A7 7 0 0 1 8 5zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" />
99
</svg>

web/src/components/PlayerList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</li>
2929
</ul>
3030
<div class="-mx-3">
31-
<button v-show="restCount > 0" class="flex w-full h-14 px-3 py-2 hover:bg-cool-gray-100 focus:outline-none rounded-md text-gray-600 text-left transition duration-100 ease-linear" @click="cursor += 50">
31+
<button v-show="restCount > 0" class="flex w-full h-14 px-3 py-2 hover:bg-cool-gray-100 rounded-md text-gray-600 text-left transition duration-100 ease-linear" @click="cursor += 50">
3232
<span class="ml-14">{{ t('nyaa.player_list.load_more_button_label') }}</span>
3333
</button>
3434
</div>

web/src/components/PlayerStatisticPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<header class="border-b border-gray-300 bg-gray-100 md:rounded-t-md flex flex-col">
44
<div class="px-page xl:px-5 flex items-center">
55
<h2 class="py-3 xl:py-4 text-cool-gray-700 text-lg xl:text-xl font-medium uppercase tracking-wide">{{ t('nyaa.player_statistics.section_title') }}</h2>
6-
<button class="ml-auto p-1 -mr-1 focus:outline-none flex" @click="showConfig = !showConfig">
6+
<button class="ml-auto p-1 -mr-1 flex" @click="showConfig = !showConfig">
77
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" :class="['w-6 h-6', showConfig ? 'fill-black' : 'fill-gray-500']">
88
<path d="M8 7a5 5 0 1 0 0 10h8a5 5 0 0 0 0-10H8zm0-2h8a7 7 0 0 1 0 14H8A7 7 0 0 1 8 5zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" />
99
</svg>

web/src/components/SearchBox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@click="isFocused = true"
1010
>
1111
<div class="xl:w-page xl:mx-auto flex">
12-
<button ref="button" class="flex-none focus:outline-none flex items-center" @click="() => {keyword && setKeyword(''); $refs.input.focus()}">
12+
<button ref="button" class="flex-none flex items-center" @click="() => {keyword && setKeyword(''); $refs.input.focus()}">
1313
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-6 fill-current">
1414
<path v-if="!keyword" d="M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15z" />
1515
<path v-else d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" />
@@ -20,7 +20,7 @@
2020
:value="keyword"
2121
type="text"
2222
:placeholder="t('nyaa.general.search_placeholder')"
23-
class="flex-1 pl-2 pr-5 py-3 bg-transparent placeholder-gray-600 focus:outline-none cursor-pointer focus:cursor-text"
23+
class="flex-1 pl-2 pr-5 py-3 bg-transparent placeholder-gray-600 cursor-pointer focus:cursor-text"
2424
@blur="$event.relatedTarget !== $refs.button && (isFocused = false)"
2525
@input="setKeyword($event.target.value)"
2626
>

0 commit comments

Comments
 (0)