style(docs): polish sidebar, header, focus, and code block UX#580
Conversation
- Sidebar: purple highlight on active/hover, remove left border - Header: full-width on docs pages, constrained on homepage - Header: Docs link non-clickable when already on docs pages - Focus: strip background-color changes on focus, only show purple outline ring on keyboard focus-visible - Skip to content: purple background on focus - Code blocks: reduce header padding for less dead space - Copy button: focus ring tightly wraps icon only (Copied! text positioned absolutely so it doesn't inflate button size) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Dashboard
Init
Other
Bug Fixes 🐛Dashboard
Event
Other
Internal Changes 🔧Coverage
Event
Other
🤖 This preview updates automatically when you update the PR. |
|
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1276 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.49% 95.48% -0.01%
==========================================
Files 194 194 —
Lines 28245 28245 —
Branches 0 0 —
==========================================
+ Hits 26973 26969 -4
- Misses 1272 1276 +4
- Partials 0 0 —Generated by Codecov Action |
The global :focus { background-color: inherit !important } rule was
stripping backgrounds from all focused elements — including the sidebar
active link's purple background, the hamburger menu button, and search
button. Since !important always beats non-!important regardless of
specificity, this directly contradicted the PR's intent.
Keep only outline: none to suppress Starlight's default focus outline.
The :focus-visible rule below provides the purple outline for keyboard
users. Element backgrounds are now preserved during focus/click.
Addresses Cursor BugBot review finding.
Define --sl-color-accent-rgb (139 92 246) alongside --sl-color-accent and replace all 12 hardcoded rgba(139, 92, 246, ...) occurrences with rgb(var(--sl-color-accent-rgb) / alpha). This makes the accent color a single source of truth across custom.css, PackageManagerCode.astro, and Terminal.astro.
BYK
left a comment
There was a problem hiding this comment.
LGTM — two follow-up commits pushed:
-
fix(docs): Removed the global
:focus { background-color: inherit !important }that was stripping backgrounds from the sidebar active link and other interactive elements on focus (Cursor BugBot finding). -
refactor(docs): Extracted
rgba(139, 92, 246, ...)into--sl-color-accent-rgbCSS custom property — replaced all 12 occurrences across custom.css, PackageManagerCode.astro, and Terminal.astro.
Build passes (23 pages). Ready to merge.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| margin: 1rem 0; | ||
| background: rgba(255, 255, 255, 0.04); | ||
| padding: 0.5rem; | ||
| padding: 0 0.5rem 0.5rem; |
There was a problem hiding this comment.
Copy button focus outline clipped by container overflow
Low Severity
The top padding of .pm-code was removed (changed from 0.5rem to 0 0.5rem 0.5rem), but the container still has overflow: hidden. The .pm-copy button sits flush against the top of the container, and its :focus-visible outline (2px width + 2px outline-offset = 4px extension) extends above the container's padding box and gets clipped. The previous 0.5rem (~8px) top padding provided enough room; the new 0 top padding does not.


Summary
:focus, show only purple outline on:focus-visibleTest plan
bun run buildpasses (23 pages)🤖 Generated with Claude Code