Skip to content

Commit 5c49292

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

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

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

Lines changed: 8 additions & 14 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,27 @@ 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
134133
&:focus-within .light-doc-item-actions {
135134
display: flex;
136135
opacity: 1;
137136
visibility: visible;
138-
background: var(--c--theme--colors--greyscale-100);
139137
}
140138
141139
.c__tree-view--node.isSelected {
142-
.light-doc-item-actions {
143-
background: var(--c--theme--colors--greyscale-100);
144-
}
145140
}
146141
147-
&:hover,
148-
&:focus-within {
142+
.c__tree-view--node:hover,
143+
.c__tree-view--node:focus-within {
149144
background-color: var(--c--theme--colors--greyscale-100);
150-
border-radius: 4px;
151145
152146
.light-doc-item-actions {
153147
display: flex;
154148
opacity: 1;
155149
visibility: visible;
156-
background: var(--c--theme--colors--greyscale-100);
150+
/* background: var(--c--theme--colors--greyscale-100); */
157151
}
158152
}
159153

0 commit comments

Comments
 (0)