Skip to content

Commit b638ff4

Browse files
committed
fix: inconsistent popover button focus outline
1 parent 2e69b1b commit b638ff4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/navigation/DesktopNavigation.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ function FeatureItems() {
4545
<Popover className='relative'>
4646
{({ open }) => (
4747
<>
48-
{/* There is a bug with Popover component that triggers :focus-visible on mouse interactions */}
49-
{/* TODO: We should change the focus state to ring when it gets fixed to stay consistent with other elements */}
5048
<Popover.Button
5149
className={clsx(
5250
open ? 'text-gray-900' : 'text-gray-500',
53-
'group inline-flex items-center rounded-md text-base font-medium hover:text-gray-900 focus:outline-none focus-visible:text-secondary'
51+
'group inline-flex items-center rounded-md text-base font-medium hover:text-gray-900 focus:outline-offset-4 focus:outline-focus [&:not(:focus-visible)]:focus:outline-none'
5452
)}
5553
>
5654
<span className='whitespace-nowrap'>Funkcje aplikacji</span>
@@ -142,7 +140,7 @@ function NavigationItems() {
142140
<Popover.Button
143141
className={clsx(
144142
open ? 'text-gray-900' : 'text-gray-500',
145-
'group inline-flex items-center rounded-md text-base font-medium hover:text-gray-900 focus:outline-none focus-visible:text-secondary'
143+
'group inline-flex items-center rounded-md text-base font-medium hover:text-gray-900 focus:outline-offset-4 focus:outline-focus [&:not(:focus-visible)]:focus:outline-none'
146144
)}
147145
>
148146
<span>Więcej</span>

src/styles/globals.css

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/* #region /**=========== Colors =========== */
77
--color-primary: 17 20 45; /* #11142d */
88
--color-secondary: 108 93 211; /* #6C5DD3 */
9+
--color-focus: rgb(59 130 246 / 0.5); /* #3b82f680 */
910
--tw-color-primary-50: 245 243 255;
1011
--tw-color-primary-100: 237 233 254;
1112
--tw-color-primary-200: 221 214 254;

tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
colors: {
1414
primary: 'rgb(var(--color-primary) / <alpha-value>)',
1515
secondary: 'rgb(var(--color-secondary) / <alpha-value>)',
16+
focus: 'var(--color-focus)',
1617
dark: '#222222',
1718
},
1819
borderRadius: {

0 commit comments

Comments
 (0)