Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/fix-sidebar-tab-ring-overflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@arkenv/fumadocs-ui": patch
---

#### Fix keyboard focus ring truncation in sidebar navigation

The drill-in sidebar slide container now uses `overflow: clip` with an expanded clip margin instead of `overflow: hidden`, preventing keyboard focus rings from being clipped along the left and right edges.
15 changes: 14 additions & 1 deletion apps/www/app/docs/docs-chrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,20 @@
}

[data-docs-sidebar-slide] {
overflow: hidden;
overflow: clip;
overflow-clip-margin: 0.5rem;
}

@supports not (overflow-clip-margin: 0.5rem) {
[data-docs-sidebar-slide] {
margin-inline: -0.25rem;
padding-inline: 0.25rem;
}

[data-docs-sidebar-slide] > nav.absolute {
width: auto;
inset-inline: 0.25rem;
}
}

/*
Expand Down
25 changes: 23 additions & 2 deletions packages/fumadocs-ui/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ aside .theme-toggle {
color 150ms,
background-color 150ms;
/* Kill the UA outline (tinted by global `outline-ring/50`) — it is
rectangular and gets clipped by the drill-in `overflow-hidden` pane. */
rectangular and gets clipped by the drill-in slide pane. */
outline: none;
}

Expand Down Expand Up @@ -459,7 +459,28 @@ aside .theme-toggle {
*/
#nd-sidebar [data-docs-sidebar-slide],
#nd-sidebar-mobile [data-docs-sidebar-slide] {
overflow: hidden;
overflow: clip;
overflow-clip-margin: 0.5rem;
Comment thread
yamcodes marked this conversation as resolved.
}

/*
* WebKit / Safari fallback: WebKit supports overflow: clip but does not yet
* support overflow-clip-margin (WebKit bug 236153). Pad the slide container
* and compensate on absolutely-positioned child panels so the 4px focus ring
* paints inside the element padding box without shifting resting or drilled navs.
*/
@supports not (overflow-clip-margin: 0.5rem) {
#nd-sidebar [data-docs-sidebar-slide],
#nd-sidebar-mobile [data-docs-sidebar-slide] {
margin-inline: -0.25rem;
padding-inline: 0.25rem;
}

#nd-sidebar [data-docs-sidebar-slide] > nav.absolute,
#nd-sidebar-mobile [data-docs-sidebar-slide] > nav.absolute {
width: auto;
inset-inline: 0.25rem;
}
}

#nd-sidebar [data-sidebar-mode],
Expand Down
2 changes: 1 addition & 1 deletion packages/fumadocs-ui/src/components/drill-in-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ function DrillInTree() {

return (
<div
className="relative overflow-hidden"
className="relative overflow-clip"
data-docs-sidebar-slide=""
style={height != null ? { height } : undefined}
>
Expand Down
Loading