Skip to content

Commit 345db00

Browse files
authored
Merge pull request #1391 from primer/nav-focus
Improve focus state for .SideNav and .menu
2 parents 1ee76b3 + 534c8f6 commit 345db00

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.changeset/chilly-yaks-hope.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Improve focus state for .SideNav and .menu

src/navigation/menu.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@
3333
&::before { border-bottom-left-radius: $border-radius; }
3434
}
3535

36-
&:focus,
36+
&:focus {
37+
z-index: 1;
38+
outline: none;
39+
box-shadow: var(--color-state-focus-shadow);
40+
}
41+
3742
&:hover {
3843
text-decoration: none;
3944
background-color: var(--color-state-hover-secondary-bg);
40-
outline: none;
4145
}
4246

4347
&:active {

src/navigation/sidenav.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@
4343

4444
// States
4545

46-
.SideNav-item:hover,
4746
.SideNav-item:focus {
47+
z-index: 1;
48+
outline: none;
49+
box-shadow: var(--color-state-focus-shadow);
50+
}
51+
52+
.SideNav-item:hover {
4853
text-decoration: none;
4954
background-color: var(--color-state-hover-secondary-bg);
5055
outline: none;

0 commit comments

Comments
 (0)