Skip to content

Commit 81eff83

Browse files
committed
fixup! ⚡️(frontend) improve accessibility of selected document's sub-menu
1 parent c45fe88 commit 81eff83

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

src/frontend/apps/impress/src/features/docs/doc-tree/components/DocSubPageItem.tsx

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
114114
aria-selected={isSelected}
115115
aria-expanded={hasChildren ? isExpanded : undefined}
116116
$css={css`
117-
background-color: ${isActive
118-
? 'var(--c--theme--colors--greyscale-100)'
119-
: 'var(--c--theme--colors--greyscale-000)'};
117+
/* Ensure the outline (handled by TreeView) matches the visual area */
118+
.c__tree-view--node {
119+
padding: ${spacingsTokens['3xs']};
120+
border-radius: 4px;
121+
}
120122
121123
.light-doc-item-actions {
122124
display: flex;
@@ -125,35 +127,18 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
125127
right: 0;
126128
top: 0;
127129
height: 100%;
128-
background: ${isDesktop
129-
? 'var(--c--theme--colors--greyscale-100)'
130-
: 'var(--c--theme--colors--greyscale-000)'};
131130
z-index: 10;
132131
}
133132
134-
&:focus-within .light-doc-item-actions {
135-
display: flex;
136-
opacity: 1;
137-
visibility: visible;
138-
background: var(--c--theme--colors--greyscale-100);
139-
}
140-
141-
.c__tree-view--node.isSelected {
142-
.light-doc-item-actions {
143-
background: var(--c--theme--colors--greyscale-100);
144-
}
145-
}
146-
147-
&:hover,
148-
&:focus-within {
133+
.c__tree-view--node:hover,
134+
.c__tree-view--node.isFocused {
149135
background-color: var(--c--theme--colors--greyscale-100);
150-
border-radius: 4px;
151136
152137
.light-doc-item-actions {
153138
display: flex;
154139
opacity: 1;
155140
visibility: visible;
156-
background: var(--c--theme--colors--greyscale-100);
141+
/* background: var(--c--theme--colors--greyscale-100); */
157142
}
158143
}
159144

0 commit comments

Comments
 (0)