Improve focus-visible outlines in navigation (#6061)
* feat add focus_visible atom * feat use focus_visible atom in Button.tsx style * Tweak --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
+4
-1
@@ -1,4 +1,4 @@
|
|||||||
import {Platform, StyleSheet, ViewStyle} from 'react-native'
|
import {Platform, StyleProp, StyleSheet, ViewStyle} from 'react-native'
|
||||||
|
|
||||||
import * as tokens from '#/alf/tokens'
|
import * as tokens from '#/alf/tokens'
|
||||||
import {native, web} from '#/alf/util/platform'
|
import {native, web} from '#/alf/util/platform'
|
||||||
@@ -887,6 +887,9 @@ export const atoms = {
|
|||||||
user_select_all: {
|
user_select_all: {
|
||||||
userSelect: 'all',
|
userSelect: 'all',
|
||||||
},
|
},
|
||||||
|
outline_inset_1: {
|
||||||
|
outlineOffset: '-1px',
|
||||||
|
} as StyleProp<ViewStyle>,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Text decoration
|
* Text decoration
|
||||||
|
|||||||
@@ -185,7 +185,14 @@ function NavItem({count, href, icon, iconFilled, label}: NavItemProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PressableWithHover
|
<PressableWithHover
|
||||||
style={[a.flex_row, a.align_center, a.p_md, a.rounded_sm, a.gap_sm]}
|
style={[
|
||||||
|
a.flex_row,
|
||||||
|
a.align_center,
|
||||||
|
a.p_md,
|
||||||
|
a.rounded_sm,
|
||||||
|
a.gap_sm,
|
||||||
|
a.outline_inset_1,
|
||||||
|
]}
|
||||||
hoverStyle={t.atoms.bg_contrast_25}
|
hoverStyle={t.atoms.bg_contrast_25}
|
||||||
// @ts-ignore the function signature differs on web -prf
|
// @ts-ignore the function signature differs on web -prf
|
||||||
onPress={onPressWrapped}
|
onPress={onPressWrapped}
|
||||||
|
|||||||
Reference in New Issue
Block a user