Skip to content

Commit

Permalink
Fix link focus rings
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Sep 19, 2024
1 parent 50e401f commit e9634bb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/VCheckbox/VCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const onChange = () => {
class="me-3 block appearance-none border border-tertiary bg-default transition-colors duration-100 checked:bg-tertiary disabled:border-disabled disabled:bg-secondary checked:disabled:border-disabled checked:disabled:bg-disabled"
:class="
isSwitch
? ['h-4.5', 'w-9', 'rounded-full', 'focus-slim-offset']
? ['h-4.5', 'w-9', '!rounded-full', 'focus-slim-offset']
: [
'h-5',
'w-5',
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ useHead({
<NuxtLayout name="default">
<VFourOhFour class="flex-grow" :error="error" />
</NuxtLayout>
<div id="modal"></div>
</Body>
</Html>
</div>
</template>

<style>
body {
/* This is used by some elements. */
--color-bg-curr-page: var(--color-bg-complementary);
}
</style>
4 changes: 3 additions & 1 deletion frontend/src/styles/accent.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ body * {
accent-color: theme("borderColor.focus");
}

:focus-visible {
a:focus-visible {
outline-style: solid;
outline-color: theme("borderColor.focus");
border-radius: theme("borderRadius.sm");
}

::selection {
Expand Down
17 changes: 12 additions & 5 deletions frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ export default {
13: "var(--color-yellow-13)",
},

focus: {
DEFAULT: "var(--color-border-focus)",
yellow: "var(--color-yellow-3",
},

// Special keywords
tx: "transparent",
curr: "currentColor",
Expand Down Expand Up @@ -426,14 +431,16 @@ export default {
"focus-slim-borderless-filled",
].map((item) => [
item,
(value) => ({
"--tw-ring-color": value,
"--tw-outline-color": value,
}),
(value) => {
return {
"--tw-ring-color": value,
"--tw-outline-color": value,
}
},
])
),
{
values: { ...theme("colors"), DEFAULT: theme("borderColor.focus") },
values: { ...theme("colors.focus") },
}
)
}),
Expand Down

0 comments on commit e9634bb

Please sign in to comment.