Skip to content

Commit 22d233b

Browse files
fix(chrome): consistent focus style for sub nav items (#1558)
1 parent d1774fd commit 22d233b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

packages/chrome/.size-snapshot.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"index.esm.js": {
3-
"bundled": 56030,
4-
"minified": 42856,
5-
"gzipped": 9010,
3+
"bundled": 56150,
4+
"minified": 42928,
5+
"gzipped": 9026,
66
"treeshaked": {
77
"rollup": {
8-
"code": 32461,
8+
"code": 32509,
99
"import_statements": 676
1010
},
1111
"webpack": {
12-
"code": 35560
12+
"code": 35608
1313
}
1414
}
1515
},
1616
"index.cjs.js": {
17-
"bundled": 61121,
18-
"minified": 47691,
19-
"gzipped": 9359
17+
"bundled": 61241,
18+
"minified": 47763,
19+
"gzipped": 9376
2020
}
2121
}

packages/chrome/src/elements/subnav/CollapsibleSubNavItem.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ import {
1616
StyledSubNavItemIconWrapper,
1717
StyledSubNavItemIcon
1818
} from '../../styled';
19+
import { useChromeContext } from '../../utils/useChromeContext';
1920

2021
/**
2122
* @extends ButtonHTMLAttributes<HTMLButtonElement>
2223
*/
2324
export const CollapsibleSubNavItem = React.forwardRef<HTMLDivElement, ICollapsibleSubNavItemProps>(
2425
({ header, children, isExpanded: controlledExpanded, onChange, ...other }, ref) => {
26+
const { isDark, isLight } = useChromeContext();
2527
const panelRef = useRef<HTMLDivElement>();
2628
const [internalExpanded, setInternalExpanded] = useState(controlledExpanded);
2729
const expanded = getControlledValue(controlledExpanded, internalExpanded);
@@ -50,6 +52,8 @@ export const CollapsibleSubNavItem = React.forwardRef<HTMLDivElement, ICollapsib
5052
<div ref={ref}>
5153
<div {...getHeaderProps({ ariaLevel: 2 })}>
5254
<StyledSubNavItemHeader
55+
isDark={isDark}
56+
isLight={isLight}
5357
{...getTriggerProps({
5458
isExpanded: expanded,
5559
index: 0,

0 commit comments

Comments
 (0)