Repository navigation
Fix sidebar focus stacking, main content focus ring and pagination borders - #160
Merged
Merged
Conversation
…rders - Sidebar: the next item's fill covered the lower edge of a focused link's ring. `Sidebar.InteractiveControl` now positions focus-visible controls with `z-index: 1`, so the ring draws above its neighbors. - Main content: `#main-content` (tabindex -1) receives focus when its text is clicked, and a key press then made it match :focus-visible, so keyboard scrolling drew the browser's ring around the whole article. It is a skip-link and page-swap target, not a control; drop its outline. - Pagination: #135 reduced the link's `$border-width solid #border` to a bare `borderColor` when the top-bar icon borders were removed, and #147 made it `#clear`, so links lost their resting border. Restore `border: true`. Hover only recolors, so geometry is unchanged and `theme.styles.Pagination.Link` border overrides still apply. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three visual fixes found while browsing the docs.
Focused sidebar links were covered by the next item
The next item's fill, such as the current page's accent surface, covered the lower edge of a focused link's ring.
Sidebar.InteractiveControlnow gives:focus-visiblecontrolsposition: relative; z-index: 1. Without offsets the link doesn't move, and the ring draws above its neighbors.The whole article showed a focus ring during keyboard scrolling
#main-contenthastabindex="-1"so the skip link and page swaps can move focus to it. Clicking any text in the article therefore focuses it. After a key press it matches:focus-visible, so scrolling with the arrow keys drew Chromium's default ring around the whole article. Cookbook's ownFocusRingrule only covers controls.MainContentnow setsoutline: none. The element stays the focus target. It isn't a control or in the Tab order, so the ring didn't help anyone.Pagination links lost their resting border
Before #135,
Pagination.Linkusedborder: "$border-width solid #border". When the top-bar icon borders were removed in #135, the pagination link was reduced to a bareborderColor, which draws nothing without a width and style. #147 then made itborder: "#clear", so the border only showed on hover. The top-bar icons were meant to lose their border; the pagination links were not.The link now uses
border: true, the idiom other bordered components use, so the border shows at rest again. Hover only changes colors, so geometry stays the same, andtheme.styles.Pagination.Linkborder overrides still apply.docs/migration.mdno longer says pagination reserves a transparent border. The top-bar icons still have no border.Tests
component-ownership.spec.tsgains two tests and one extended test:z-index: 1, andautowhile unfocused.#main-contentis focused and matches:focus-visible, but itsoutline-styleisnone.1px solidin the theme's--border-color, and thecustom-headeroverride (3px dashed) still applies.Without the style changes, all three fail:
staticinstead ofrelative,autoinstead ofnone, and a transparent border color. With them, all three pass. I also checked the reference site in Chromium.Review and validation
I followed the local review procedure (
.claude/skills/review/SKILL.md) for the diff and found no violations:@own(:focus-visible)targets only the selected control.theme.stylesoverrides merge as before.All of these passed locally:
pnpm buildpnpm lint(zero warnings)pnpm format:checkpnpm typecheckpnpm test(409 tests)pnpm check:browser(99 tests)pnpm check:themingEntropy change (renderer styles): Neutral. Each fix is a property or condition inside its owning style, with no new concept, sub-element or option. The pagination change restores the earlier declaration.
Entropy change (browser tests): Slightly Increased, justified. It adds two focused specs and three assertions to an existing one, each needed to catch its regression.
There are no exceptions or follow-ups.
🤖 Generated with Claude Code