File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @primer/react " : patch
3
+ ---
4
+
5
+ Add focus styles to Pagination component
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import Box from '../Box'
4
4
import { get } from '../constants'
5
5
import type { SxProp } from '../sx'
6
6
import sx from '../sx'
7
- import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'
8
7
import { buildComponentData , buildPaginationModel } from './model'
9
8
import type { ResponsiveValue } from '../hooks/useResponsiveValue'
10
9
import { viewportRanges } from '../hooks/useResponsiveValue'
@@ -56,7 +55,10 @@ const Page = styled.a`
56
55
transition-duration: 0.1s;
57
56
}
58
57
59
- ${ getGlobalFocusStyles ( 0 ) } ;
58
+ &:focus-visible {
59
+ outline: 2px solid ${ get ( 'colors.accent.emphasis' ) } ;
60
+ outline-offset: -2px;
61
+ }
60
62
61
63
&:active {
62
64
border-color: ${ get ( 'colors.border.muted' ) } ;
@@ -74,6 +76,12 @@ const Page = styled.a`
74
76
border-color: transparent;
75
77
}
76
78
79
+ &[aria-current]:focus-visible {
80
+ outline: 2px solid ${ get ( 'colors.accent.emphasis' ) } ;
81
+ outline-offset: -2px;
82
+ box-shadow: inset 0 0 0 3px ${ get ( 'colors.fg.onEmphasis' ) } ;
83
+ }
84
+
77
85
&[aria-disabled],
78
86
&[aria-disabled]:hover {
79
87
margin: 0 2px;
@@ -196,7 +204,7 @@ const PaginationContainer = styled.nav<SxProp>`
196
204
.TablePaginationSteps[data-hidden-viewport-ranges*='${ viewportRangeKey } '] > *:first-child {
197
205
margin-inline-end: 0;
198
206
}
199
-
207
+
200
208
.TablePaginationSteps[data-hidden-viewport-ranges*='${ viewportRangeKey } '] > *:last-child {
201
209
margin-inline-start: 0;
202
210
}
You can’t perform that action at this time.
0 commit comments