Skip to content

Commit

Permalink
(A11y) Increase visibility of focus outline
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-blanchard committed Nov 15, 2024
1 parent 67742fe commit b314f0d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __tests__/components/ActionButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ActionButton', () => {
render(<ActionButton text="my-button-text" style="primary" />)
const sut = screen.getByText('my-button-text')
expect(sut).toHaveClass(
'inline-flex justify-center items-center font-display align-middle border shadow-sm focus:ring-1 focus:ring-offset-2 focus:ring-black focus:text-basic-white disabled:opacity-70 disabled:cursor-not-allowed disabled:shadow-none disabled:pointer-events-none undefined px-3.5 py-2.5 rounded text-base border-blue-dark bg-blue-dark text-basic-white focus:bg-blue-normal hover:bg-blue-normal active:bg-blue-active',
'inline-flex justify-center items-center font-display align-middle border shadow-sm focus:ring-2 focus:ring-offset-2 focus:ring-black focus:text-basic-white disabled:opacity-70 disabled:cursor-not-allowed disabled:shadow-none disabled:pointer-events-none undefined px-3.5 py-2.5 rounded text-base border-blue-dark bg-blue-dark text-basic-white focus:bg-blue-normal hover:bg-blue-normal active:bg-blue-active',
)
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ActionButton = ({
type,
}: ActionButtonProps) => {
const baseClasses =
'align-middle border font-display inline-flex items-center justify-center shadow-sm disabled:cursor-not-allowed disabled:opacity-70 disabled:pointer-events-none disabled:shadow-none focus:ring-1 focus:ring-black focus:ring-offset-2'
'align-middle border font-display inline-flex items-center justify-center shadow-sm disabled:cursor-not-allowed disabled:opacity-70 disabled:pointer-events-none disabled:shadow-none focus:ring-2 focus:ring-black focus:ring-offset-2'
const fullWidthClasses = fullWidth ? 'w-full' : undefined
const sizeClasses = sizes[size ?? 'md']
const styleClasses = styles[style ?? 'default']
Expand Down
2 changes: 1 addition & 1 deletion src/components/LinkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const LinkButton = ({
style,
}: LinkButtonProps) => {
const baseClasses =
'align-middle border font-display inline-flex items-center justify-center no-underline shadow-sm text-center focus:ring-1 focus:ring-black focus:ring-offset-2'
'align-middle border font-display inline-flex items-center justify-center no-underline shadow-sm text-center focus:ring-2 focus:ring-black focus:ring-offset-2'
const fullWidthClasses = fullWidth ? 'w-full' : undefined
const sizeClasses = sizes[size ?? 'md']
const styleClasses = styles[style ?? 'default']
Expand Down
3 changes: 2 additions & 1 deletion src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/* consistent focus styles on all components */
* {
@apply focus:outline-none;
@apply focus-visible:ring-1;
@apply focus-visible:ring-2;
@apply focus-visible:ring-offset-2;
@apply focus-visible:ring-black;
}

Expand Down

0 comments on commit b314f0d

Please sign in to comment.