Skip to content

Commit

Permalink
💄(keyboard) better handling of focus ring
Browse files Browse the repository at this point in the history
some focus rings were shown even when we only used the mouse. this
globally fixes that
  • Loading branch information
manuhabitela committed Jul 21, 2024
1 parent e6c292e commit 9fd1af2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/primitives/A.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const link = cva({
base: {
textDecoration: 'underline',
textUnderlineOffset: '2',
transition: 'all 200ms',
cursor: 'pointer',
borderRadius: 2,
'_ra-hover': {
textDecoration: 'none',
},
Expand All @@ -26,7 +26,7 @@ const link = cva({
export type AProps = LinkProps & RecipeVariantProps<typeof link>

/**
* anchor component styled with underline
* anchor component styled with underline. Used mostly for external links. Use Link for internal links
*/
export const A = ({ size, ...props }: AProps) => {
return <Link {...props} className={link({ size })} />
Expand Down
12 changes: 12 additions & 0 deletions src/frontend/src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ body,
#root {
height: 100%;
}

* {
outline: none;
}

[data-rac][data-focus-visible],
:is(a, button, input, select, textarea):not([data-rac]):focus-visible {
outline: 2px solid black;
outline-offset: 1px;
outline-color: Highlight;
outline-color: -webkit-focus-ring-color;
}

0 comments on commit 9fd1af2

Please sign in to comment.