Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
82830801
Commit
82830801
authored
Nov 13, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
Nov 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve menu items focus ring styles
parent
63d5775a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
MenuItem.tsx
src/sidebar/components/MenuItem.tsx
+6
-4
No files found.
src/sidebar/components/MenuItem.tsx
View file @
82830801
...
@@ -239,7 +239,11 @@ export default function MenuItem({
...
@@ -239,7 +239,11 @@ export default function MenuItem({
const
wrapperClasses
=
classnames
(
const
wrapperClasses
=
classnames
(
'focus-visible-ring ring-inset'
,
'focus-visible-ring ring-inset'
,
'w-full min-w-[150px] flex items-center select-none'
,
'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
// Set this container as a "group" so that children may style based on its
// layout state.
// layout state.
// See https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state
// See https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state
...
@@ -260,8 +264,6 @@ export default function MenuItem({
...
@@ -260,8 +264,6 @@ export default function MenuItem({
// of a transparent left border to make focus ring cover the full
// 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.
// menu item. Otherwise the focus ring will be inset on the left too far.
'pl-[4px]'
:
!
isSelected
,
'pl-[4px]'
:
!
isSelected
,
'border-b-grey-3'
:
isExpanded
,
'border-b-transparent'
:
!
isExpanded
,
'text-color-text-light'
:
isDisabled
,
'text-color-text-light'
:
isDisabled
,
'text-color-text hover:text-color-text'
:
!
isDisabled
,
'text-color-text hover:text-color-text'
:
!
isDisabled
,
},
},
...
@@ -312,7 +314,7 @@ export default function MenuItem({
...
@@ -312,7 +314,7 @@ export default function MenuItem({
<
MenuKeyboardNavigation
<
MenuKeyboardNavigation
closeMenu=
{
onCloseSubmenu
}
closeMenu=
{
onCloseSubmenu
}
visible=
{
isSubmenuVisible
}
visible=
{
isSubmenuVisible
}
className=
"border-
b
"
className=
"border-
y border-grey-3
"
>
>
{
submenu
}
{
submenu
}
</
MenuKeyboardNavigation
>
</
MenuKeyboardNavigation
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment