Skip to content

website: Make the active sidebar item stand out - #3237

Merged
huacnlee merged 6 commits into
mainfrom
docs-sidebar-active
Sep 25, 2026
Merged

huacnlee merged 6 commits into
mainfrom
docs-sidebar-active

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Closes #3190

Summary

The active page in the docs sidebar was marked only by font-weight: 650 on text that is already --foreground, so after scrolling a long page like Editor it took a moment to find again.

  • The active item now takes the --sidebar-accent fill (#e5e5e5 light / #262626 dark), stronger than the --secondary hover fill, and keeps the heavier weight. No leading-edge bar.
  • Each item has a 1px transparent border with the fill clipped to the padding box, so the hover and active fills of adjacent items sit 2px apart instead of merging. Padding is reduced by the same pixel, so row height (28.4px) and text alignment are unchanged.
  • The active link carries aria-current="page".
  • Section root links (/docs, /component, /shell) prefix-matched every page in their section, so e.g. /docs/getting-started marked both "GPUI Kit" and "Getting Started" active. Only the longest matching link is active now.

Design rule

Design Guides → Interaction states now states that selected navigation items, list rows and tabs are shown through the item's own surface (fill, foreground, weight), never a leading-edge bar or one-sided border. Added in website/docs/design-guides.md and website/zh-CN/docs/design-guides.md. website/DESIGN.md no longer reserves --brand for an "active sidebar indicator" and states the fill-only rule.

Verification

Dev server + headless Chromium on /component/editor, light and dark: exactly one .sidebar-item.active, computed background rgb(229,229,229) / rgb(38,38,38). Checked /docs, /docs/getting-started, /component, /zh-CN/component/editor and /shell each resolve to a single active item.

🤖 Generated with Claude Code

The current page was marked only by a heavier weight on text that is
already the foreground colour, so it was hard to find again after
scrolling a long article. Give it the sidebar accent fill and a brand bar
on its leading edge, and mark it with `aria-current="page"`.

Section root links (`/docs`, `/component`, `/shell`) prefix every page in
their section, so they were marked active alongside the real page. Only the
longest matching link is active now.

Closes #3190

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@huacnlee huacnlee changed the title docs: Make the active sidebar item stand out website: Make the active sidebar item stand out Sep 25, 2026
huacnlee and others added 2 commits September 25, 2026 23:06
A leading-edge bar is a web template habit, not a desktop convention: it
breaks the item's rounded silhouette and adds a competing edge. The active
sidebar item keeps the accent fill and heavier weight only.

Write the rule into the Design Guides (en, zh-CN, and the vendored skill
copy, which also picks up edits it had missed) and into website/DESIGN.md,
which no longer reserves `--brand` for an active sidebar indicator.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A 1px transparent border with the fill clipped to the padding box leaves
a 2px gap between the hover and active fills of neighbouring items. The
padding gives the pixel back, so rows keep their height and alignment.

Leave the vendored skill copy of the Design Guides untouched.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@huacnlee
huacnlee enabled auto-merge (squash) September 25, 2026 15:14
huacnlee and others added 3 commits September 25, 2026 23:15
The selection-marker rule stays in website/DESIGN.md only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@huacnlee
huacnlee merged commit d89cd9c into main Sep 25, 2026
12 checks passed
@huacnlee
huacnlee deleted the docs-sidebar-active branch September 25, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: improve active component highlight in sidebar navigation

1 participant