Skip to content

Commit 21635a6

Browse files
authored
Merge pull request #1092 from trillium/ts.add_outline_styles_for_links_buttons
fix: Add outline focus-visible styles for buttons, links
2 parents 94e87c9 + 4df6812 commit 21635a6

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

components/Header.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ const Header = () => {
2929
</div>
3030
</Link>
3131
<div className="flex items-center space-x-4 leading-5 sm:space-x-6">
32-
<div className="no-scrollbar hidden max-w-40 items-center space-x-4 overflow-x-auto sm:flex sm:space-x-6 md:max-w-72 lg:max-w-96">
32+
<div className="no-scrollbar hidden max-w-40 items-center space-x-4 overflow-x-auto pr-2 sm:flex sm:space-x-6 md:max-w-72 lg:max-w-96">
3333
{headerNavLinks
3434
.filter((link) => link.href !== '/')
3535
.map((link) => (
3636
<Link
3737
key={link.title}
3838
href={link.href}
39-
className="block font-medium text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
39+
className="m-1 block font-medium text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
4040
>
4141
{link.title}
4242
</Link>

tailwind.config.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,20 @@ module.exports = {
7272
}),
7373
},
7474
},
75-
plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')],
75+
plugins: [
76+
require('@tailwindcss/forms'),
77+
require('@tailwindcss/typography'),
78+
({ addBase, theme }) => {
79+
addBase({
80+
'a, button': {
81+
outlineColor: theme('colors.primary.500'),
82+
'&:focus-visible': {
83+
outline: '2px solid',
84+
borderRadius: theme('borderRadius.DEFAULT'),
85+
outlineColor: theme('colors.primary.500'),
86+
},
87+
},
88+
})
89+
},
90+
],
7691
}

0 commit comments

Comments
 (0)