💄(keyboard) better handling of focus ring

some focus rings were shown even when we only used the mouse. this
globally fixes that
This commit is contained in:
Emmanuel Pelletier
2024-07-21 16:03:09 +02:00
parent e6c292ecd7
commit 9fd1af2302
2 changed files with 14 additions and 2 deletions

View File

@@ -5,8 +5,8 @@ const link = cva({
base: {
textDecoration: 'underline',
textUnderlineOffset: '2',
transition: 'all 200ms',
cursor: 'pointer',
borderRadius: 2,
'_ra-hover': {
textDecoration: 'none',
},
@@ -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 })} />

View File

@@ -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;
}