Skip to content

Commit

Permalink
Improve menu items focus ring styles
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Nov 13, 2023
1 parent 63d5775 commit 8283080
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/sidebar/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ export default function MenuItem({
const wrapperClasses = classnames(
'focus-visible-ring ring-inset',
'w-full min-w-[150px] flex items-center select-none',
'border-b rounded-none cursor-pointer',
'rounded-none cursor-pointer',
{
'focus-visible:rounded-lg': !isSelected,
'focus-visible:rounded-r-lg': isSelected,
},
// Set this container as a "group" so that children may style based on its
// layout state.
// See https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state
Expand All @@ -260,8 +264,6 @@ export default function MenuItem({
// of a transparent left border to make focus ring cover the full
// menu item. Otherwise the focus ring will be inset on the left too far.
'pl-[4px]': !isSelected,
'border-b-grey-3': isExpanded,
'border-b-transparent': !isExpanded,
'text-color-text-light': isDisabled,
'text-color-text hover:text-color-text': !isDisabled,
},
Expand Down Expand Up @@ -312,7 +314,7 @@ export default function MenuItem({
<MenuKeyboardNavigation
closeMenu={onCloseSubmenu}
visible={isSubmenuVisible}
className="border-b"
className="border-y border-grey-3"
>
{submenu}
</MenuKeyboardNavigation>
Expand Down

0 comments on commit 8283080

Please sign in to comment.