fix(fumadocs-ui): prevent sidebar focus ring clipping with overflow-clip - #1743
Conversation
🦋 Changeset detectedLatest commit: 195e2d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@arkenv/agent-plugin
arkenv
@arkenv/build
@arkenv/bun-plugin
@arkenv/core
@arkenv/fumadocs-ui
@arkenv/nextjs
@arkenv/nuxt
@arkenv/standard
@arkenv/vite-plugin
commit: |
There was a problem hiding this comment.
Important
overflow-clip-margin is not supported in Safari/WebKit, so the focus-ring fix silently no-ops there — WebKit still clips the ring exactly as it did before.
Reviewed changes
- Drill-in pane overflow — the slide pane's
overflow: hiddenbecameoverflow: clipplusoverflow-clip-margin: 0.5remin bothpackages/fumadocs-ui/css/theme.cssandapps/www/app/docs/docs-chrome.css, and the inline Tailwind class indrill-in-sidebar.tsxflipped fromoverflow-hiddentooverflow-clip, letting the 4px focus ring and 0.25rem pill radius paint into the column gutter without moving the rail insets. - Changeset — adds a patch changeset for
@arkenv/fumadocs-ui.
The mechanism is sound and matches the design intent already documented in the code comments (theme.css:440-459). The overflow: hidden → clip transition is also safe for the drill-in behavior: the pane's height is always set to the visible panel's scrollHeight, and the parked panel is translated ±120%, far beyond the 8px clip margin, so no leak regression. One concern is anchored inline below.
ℹ️ Nitpicks
packages/fumadocs-ui/css/theme.css:419still describes the pane as "the drill-inoverflow-hiddenpane" — that comment predates this change and is now stale.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The WebKit fallback fixes the ring clipping but misaligns the resting top-level Sections panel on Safari: the left/inset-inline offsets that restore the absolute drill panels act as a 4px translation on the position: relative root nav, so items jump sideways when drilling — contradicting the "exact 24px active-pill rail alignment" the fallback's own comment claims to preserve.
The prior Safari concern and the stale-comment nitpick from the last review are addressed by this commit — the @supports not (overflow-clip-margin: 0.5rem) fallback is the right mechanism, and the theme.css:419 comment now reads accurately. The geometry of the fallback itself has one flaw, anchored inline.
Reviewed changes
- WebKit
overflow-clip-marginfallback — added@supports not (overflow-clip-margin: 0.5rem)blocks in bothpackages/fumadocs-ui/css/theme.cssandapps/www/app/docs/docs-chrome.cssthat extend the slide pane's border box viamargin-inline: -0.25rem, compensate withpadding-inline: 0.25rem, and inset child navs, so the 4px ring paints inside the clip region when clip-margin is unavailable. - Stale comment cleanup — the
theme.csscomment describing the drill-in pane asoverflow-hiddennow refers to the "slide pane" generically.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ Prior feedback fully addressed. The incremental change scopes the WebKit fallback's
inset-inlinecompensation to[data-docs-sidebar-slide] > nav.absolutein both CSS files, so the restingposition: relativeroot nav no longer absorbs the offset as a 4px translation — resting and drilled panels keep identical 24px rail alignment, which I re-verified against the current markup (drill-in-sidebar.tsxtoggles the root nav betweenrelativeandabsolute inset-x-0 top-0). No new issues found.
Reviewed changes
- Scoped fallback inset to absolute panels — the
@supports not (overflow-clip-margin: 0.5rem)block in bothpackages/fumadocs-ui/css/theme.cssandapps/www/app/docs/docs-chrome.cssnow matches> nav.absolute(dropping the physicalleft/rightin favor of logicalinset-inline), so only the absolutely-positioned drill panels are pulled back to the content box while the resting root nav stays untouched. - Comment refresh — the fallback comment now describes the absolute-panel scoping, matching the "exact 24px active-pill rail alignment" claim.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Summary
Fixes an issue where keyboard focus-visible rings on drill-in sidebar items were being truncated along their left and right edges.
Root Cause
[data-docs-sidebar-slide]usedoverflow: hidden, clipping the 4px outer box-shadow focus ring of full-width sidebar items along the left and right boundaries, despite having 23px of column gutter padding available outside the container.Changes
overflow: hiddentooverflow: clip; overflow-clip-margin: 0.5rem;on[data-docs-sidebar-slide]inpackages/fumadocs-ui/css/theme.cssandapps/www/app/docs/docs-chrome.css.overflow-hiddenwithoverflow-clipinpackages/fumadocs-ui/src/components/drill-in-sidebar.tsx.@arkenv/fumadocs-ui.Verification
pnpm checkandpnpm typecheckpass with zero errors.