diff --git a/src/components/ComboboxMenu.tsx b/src/components/ComboboxMenu.tsx index c8b14d7..e8fa87d 100644 --- a/src/components/ComboboxMenu.tsx +++ b/src/components/ComboboxMenu.tsx @@ -82,7 +82,9 @@ export const ComboboxMenu = { if (item.subitems) { // open submenu @@ -116,7 +118,15 @@ export const ComboboxMenu = { subitem.onSelect?.(subitem.value); onItemSelected?.(); @@ -168,7 +178,7 @@ Styled.Command = styled(Command)<{ $withStickyLayout?: boolean }>` background-color: var(--comboboxMenu-backgroundColor); border-radius: inherit; - input:focus { + input:focus-visible { outline: none; } @@ -272,7 +282,7 @@ Styled.Item = styled(Command.Item)` align-items: center; gap: 0.5rem; - &[aria-disabled="true"] { + &[aria-disabled='true'] { opacity: 0.75; cursor: not-allowed; } diff --git a/src/components/Dialog.tsx b/src/components/Dialog.tsx index 8222c4e..32cdf26 100644 --- a/src/components/Dialog.tsx +++ b/src/components/Dialog.tsx @@ -90,10 +90,7 @@ export const Dialog = ({ return ( {slotTrigger && {slotTrigger}} - + {showOverlay && } withFocusStickyRows && css` - &:focus, + &:focus-visible, &:focus-within { ${layoutMixins.sticky} z-index: 1; diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx index e1ae672..11e4b40 100644 --- a/src/components/Toast.tsx +++ b/src/components/Toast.tsx @@ -118,8 +118,7 @@ const $Root = styled(Root)` align-items: end; transform-origin: left bottom; - animation: - ${keyframes` + animation: ${keyframes` from { /* scale: 0; */ grid-template-rows: 0fr; // height transition @@ -150,7 +149,7 @@ const $Root = styled(Root)` } } - &:focus { + &:focus-visible { outline: none; } @@ -203,8 +202,8 @@ const $Container = styled.div` // Rules ${popoverMixins.popover} padding: 1rem; - box-shadow: - 0 0 0 var(--border-width) var(--color-border), // border + box-shadow: 0 0 0 var(--border-width) var(--color-border), + // border 0 0 0.5rem 0.1rem var(--color-layer-2); // shadow ${$Root}:focus:not([data-swipe='end']) & { diff --git a/src/components/WithConfirmationPopover.tsx b/src/components/WithConfirmationPopover.tsx index b9ac9fa..f2aabcc 100644 --- a/src/components/WithConfirmationPopover.tsx +++ b/src/components/WithConfirmationPopover.tsx @@ -91,7 +91,7 @@ const Styled: Record = {}; Styled.Content = styled(Content)` z-index: 1; - &:focus { + &:focus-visible { outline: none; } `; diff --git a/src/index.css b/src/index.css index 99b6432..869904f 100644 --- a/src/index.css +++ b/src/index.css @@ -54,7 +54,7 @@ button:disabled { cursor: pointer; } -:focus { +:focus-visible{ outline: var(--color-accent) 1px solid; outline-offset: -1px; /* outline-offset: -2px; */ diff --git a/src/styles/popoverMixins.ts b/src/styles/popoverMixins.ts index 17be685..733e18f 100644 --- a/src/styles/popoverMixins.ts +++ b/src/styles/popoverMixins.ts @@ -214,7 +214,7 @@ export const popoverMixins = { /* &:hover, */ /* :not(:has(* > [data-highlighted])) > &:hover, */ &[data-radix-collection-item]:hover, // @radix-ui/react-navigation-menu - /* &:focus, */ + /* &:focus-visible, */ &[aria-selected="true"], // cmdk &[data-highlighted] // @radix-ui { diff --git a/src/views/MarketsDropdown.tsx b/src/views/MarketsDropdown.tsx index ea5d0b0..283b795 100644 --- a/src/views/MarketsDropdown.tsx +++ b/src/views/MarketsDropdown.tsx @@ -304,7 +304,7 @@ Styled.Popover = styled(Popover)` } `} 0.2s; } - &:focus { + &:focus-visible { outline: none; } `; diff --git a/src/views/tables/Orderbook.tsx b/src/views/tables/Orderbook.tsx index 19658be..0741c07 100644 --- a/src/views/tables/Orderbook.tsx +++ b/src/views/tables/Orderbook.tsx @@ -510,7 +510,7 @@ Styled.OrderbookTable = styled(OrderbookTradesTable)` content: ''; } - &:not(:active):is(:focus, :focus-within) { + &:not(:active):is(:focus-visible, :focus-within) { ${orderbookMixins.scrollSnapItem} z-index: 2; diff --git a/src/views/tables/OrderbookTradesTable.tsx b/src/views/tables/OrderbookTradesTable.tsx index 4209e90..f02aae3 100644 --- a/src/views/tables/OrderbookTradesTable.tsx +++ b/src/views/tables/OrderbookTradesTable.tsx @@ -72,8 +72,8 @@ export const OrderbookTradesTable = styled(Table)<{ histogramSide: 'left' | 'rig } tbody tr:hover, - tr:focus, - td:focus { + tr:focus-visible, + td:focus-visible { color: var(--color-text-2); background-color: var(--color-layer-3); }