Skip to content

Commit 1697f78

Browse files
committed
✨(frontend) refine focus outline with shadow for visual consistency
aligns focus state with app style by adding background shadow to outline Signed-off-by: Cyril <[email protected]>
1 parent 4aee866 commit 1697f78

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
121121
background: var(--c--theme--colors--greyscale-100);
122122
}
123123
}
124+
.c__tree-view--node.isFocused {
125+
outline: none !important;
126+
box-shadow: 0 0 0 2px var(--c--theme--colors--primary-500) !important;
127+
border-radius: 4px;
128+
}
124129
&:hover {
125130
background-color: var(--c--theme--colors--greyscale-100);
126131
border-radius: 4px;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ export const DocTree = ({ currentDoc }: DocTreeProps) => {
181181
role="tree"
182182
aria-label={t('Document tree')}
183183
$css={css`
184+
/* Remove outline from TreeViewItem wrapper elements */
185+
.c__tree-view--row {
186+
outline: none !important;
187+
188+
&:focus-visible {
189+
outline: none !important;
190+
}
191+
}
192+
184193
.c__tree-view--container {
185194
z-index: 1;
186195
margin-top: -10px;
@@ -217,6 +226,12 @@ export const DocTree = ({ currentDoc }: DocTreeProps) => {
217226
background-color: var(--c--theme--colors--greyscale-100);
218227
}
219228
229+
&:focus-visible {
230+
outline: none !important;
231+
box-shadow: 0 0 0 2px var(--c--theme--colors--primary-500) !important;
232+
border-radius: 4px;
233+
}
234+
220235
.doc-tree-root-item-actions {
221236
display: 'flex';
222237
opacity: ${rootActionsOpen ? '1' : '0'};

0 commit comments

Comments
 (0)