From a6a9146b97d7dd720d0be6e52f8c453513f333fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20G=C3=B6decken?= Date: Fri, 22 Nov 2024 09:03:34 +0100 Subject: [PATCH] fix(menu): focus styles --- src/primevue/menu/menu.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/primevue/menu/menu.ts b/src/primevue/menu/menu.ts index 44bd34f..4f906d0 100644 --- a/src/primevue/menu/menu.ts +++ b/src/primevue/menu/menu.ts @@ -6,10 +6,17 @@ const menu: MenuPassThroughOptions = { class: tw`ris-body2-regular bg-white shadow`, }, list: { - class: tw``, + class: tw`focus-visible:outline-none`, }, - item: { - class: tw`relative h-48 pl-16 pr-12 after:absolute after:-bottom-1 after:left-16 after:right-16 after:border-b after:border-gray-300 after:content-[''] last:after:border-b-0 hover:bg-gray-100`, + item: ({ context }) => { + const base = tw`relative h-48 pl-16 pr-12 after:absolute after:-bottom-1 after:left-16 after:right-16 after:border-b after:border-gray-300 after:content-[''] last:after:border-b-0 hover:bg-gray-100`; + const focused = tw`outline-none outline-4 outline-offset-4 outline-blue-800`; + return { + class: { + [base]: true, + [focused]: context.focused, + }, + }; }, itemContent: { class: tw`flex h-full items-center py-4`,