fix(sidebar): match L2+ group headers to nested leaf font size#1989
Merged
Conversation
Nested (L2+) group headers rendered at the L1 base size (16px) instead of the small size (14px) used by every other L2+ entry. Leaf items apply the `small` class for level != 0, but the group-title anchor in group.html carried no class, so collapsible parents stayed at the base size at any depth. Add `small` to the group anchor when the group is nested. Groups sit one level deeper than leaves (a top-level group is level 1, a top-level leaf is level 0), so the threshold is `gt $level 1` here versus `ne $level 0` for items. Top-level (L1) group headers are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
🎉 This PR is included in version 2.18.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
The sidebar mixes font sizes by intent: L1 entries render at the base size (16px) and L2+ entries at the
smallsize (14px). But nested (L2+) group headers render at 16px instead of 14px, so a collapsible parent looks larger than the leaves around it at the same visual level.Root cause
Leaves and group headers are rendered by two different inline partials, and only one applies the
smallclass:inline/sidebar/item.html) addsmallto the anchor forlevel != 0, so nested leaves are 14px. ✓inline/sidebar/group.html) render the title anchor with no class at all, so every collapsible parent inherits the 16px base regardless of depth. ✗Fix
Add
smallto the group anchor when the group is nested:Groups sit one level deeper than leaves in the recursion (a top-level group is
level 1, a top-level leaf islevel 0), so the threshold isgt $level 1here versusne $level 0for items. Top-level (L1) group headers are unchanged.Verification
Built
exampleSiteagainst the change. The shipped example content never nests groups two deep, so a temporary 3-level fixture was added to exercise the L2+ group path, then removed:small?A full scan of every rendered page confirmed 240 L1 group headers, none wrongly shrunk — no regression. The change is CSS-class only (Bootstrap
.small) and does not affect the group link's color/layout rules or the collapse chevron.🤖 Generated with Claude Code