Skip to content

feat(website): flat sidebar rows, and a band for the open page - #427

Open
IanoNjuguna wants to merge 1 commit into
IntersectMBO:mainfrom
IanoNjuguna:feat/sidebar-rows
Open

IanoNjuguna wants to merge 1 commit into
IntersectMBO:mainfrom
IanoNjuguna:feat/sidebar-rows

Conversation

@IanoNjuguna

Copy link
Copy Markdown
Contributor

Description

One file. website/src/css/custom.css loses 209 lines of !important overrides and gains 60 token-driven ones.

The open page is now marked the way docs.logos.co marks it, which is the same Docusaurus version and the same Infima markup: a surface band plus a thin rule, with the label staying ink. Until now it was a colour change, blue text and a 3px blue rule on a transparent fill, which reads as a link rather than a location.

Measured after the change, light theme:

active background   rgb(245, 243, 235)   Moon
active rule         2px rgb(35, 83, 255)  Genie Blue
active text         rgb(29, 29, 27)       Midnight, weight 400
active radius       0px
chevrons per row    1

The two judgement calls are variables rather than decisions baked into the CSS:

--sidebar-row-weight   400 default; 500 matches the reference exactly, but Poppins
                       500 reads heavier than Public Sans 500 at the same size
--sidebar-row-radius   0 default; 4px restores the previous chip shape

Fixes #426.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • I have tested these changes locally
  • I have checked for broken links

Checklist

  • My code follows the style guidelines
  • I have performed a self-review

Verification

Built and served, then measured in the browser at 1280 in both themes, with the hover and active states driven rather than eyeballed. Three-way comparison of before, weight 500 and weight 400:

/home/ian/.hermes/cache/scratch/shots/sidebar-3way-light.png
/home/ian/.hermes/cache/scratch/shots/sidebar-3way-dark.png

Light and dark both carry: band distinguishable from the page, blue rule visible, ink label at a single weight, one chevron per category, unchanged 4px rhythm between rows.

Notes

  • A latent bug this exposed. Every category started drawing two chevrons once the old block went: ours from the swizzled DocSidebarItem/Category, and Infima's .menu__caret::before. The pseudo-arrow had only been hidden because the old CSS set background: transparent !important on it. It is now display: none explicitly, and the swizzled SVG carries the hover and rotation easing.
  • Interaction, not only appearance. border-color now transitions with background at 180ms cubic-bezier(.2,.7,.2,1), so the rule moves with the fill instead of snapping. Hover tints at 5% ink, which the previous design had as a no-op.
  • Nesting. A category with an active child stays neutral, so the band belongs to the page that is open rather than to every folder above it.
  • Not in this PR. Two labels still truncate because they are doc titles. That is sidebar_label frontmatter per page and belongs in its own change; the issue says so.

…page

Replaces 248 lines of !important overrides with 88 token-driven ones. The
active row is a surface band plus a 2px brand rule with ink text instead of a
colour change, rows are square and flush, and hover tints at 5% ink so a row
responds before it is clicked.

Two knobs carry the open decisions: --sidebar-row-weight (400, set 500 for the
reference weight) and --sidebar-row-radius (0, set 4px for the old chip).

Also fixes a latent bug this exposed: Infima's .menu__caret::before arrow only
stayed hidden because the old block neutered it with background: transparent
!important. It is now hidden explicitly, so each category draws one chevron.

This branch has not been deployed

No deployments
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(site): style the sidebar as flat rows, and mark the open page with a band

1 participant