Repository navigation
Restore the gap above top-level sidebar sections - #158
Merged
Merged
Conversation
#147 moved Sidebar.TopLevelSpacing and Sidebar.GroupSpacing from class and :is() selectors to the `top-level` and `section` states. Tasty compiles states to zero-specificity :where(), so both rules now tie on `ul > li + li`. Tasty emitted the zero-margin TopLevelSpacing rule last, so it won and sections lost their gap. Limit TopLevelSpacing to `top-level & !section` so the two rules can't match the same item and rule order no longer matters. This matches the spacing from before #147, and both sub-element names stay the same. 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.
Top-level sidebar sections (Start, Author, Customize, …) lost the gap above their headings, which made the sidebar look dense. This was a regression from #147.
Cause
Before #147, the two spacing rules had different specificity:
The
:is()condition madeGroupSpacingmore specific, so sections kept their gap. #147 moved both rules to states onul > li + li. Tasty compiles states to:where(), which adds no specificity:Both rules match a section, and they now tie. Tasty emits the zero-margin rule last, so it wins.
Fix
TopLevelSpacingnow uses@own(top-level & !section). The two rules can no longer match the same item, so their order doesn't matter. The resulting spacing matches what the sidebar had before #147.Sidebar.TopLevelSpacingandSidebar.GroupSpacingkeep their names, and partialtheme.stylesoverrides merge as before.docs/component-styles.mdlists only the names, so it needs no update.On the reference site, each top-level section now has a 20px margin above it (2.5 × the 8px
--gap). The first item, Overview, stays flush.Test
A new spec in
component-ownership.spec.tschecks two things:sidebar-badgesfixture, the second top-level section has a 20px margin above it.manualfixture, adjacent non-section top-level entries stay flush.Without the fix, the spec fails (
Received: "0px"). With the fix, it passes.Review and validation
I followed the local review procedure (
.claude/skills/review/SKILL.md) for the diff and found no violations:@owntargets only the selected<li>.$path is repeated in a state map.While checking for related issues, I looked at the other sidebar sub-elements that share a selector. Base and hover pairs such as
Close/HoverCloseare safe because Tasty emits rules without states first. The remaining stateful pairs either can't match together or differ in specificity. I did not audit the other components that #147 converted.All of these passed locally:
pnpm buildpnpm lint(zero warnings)pnpm format:checkpnpm typecheckpnpm test(409 tests)pnpm check:browser(97 tests)pnpm check:themingEntropy change (sidebar styles): Neutral. One existing condition is narrowed, with a comment explaining why. There is no new concept, sub-element or option.
Entropy change (browser tests): Slightly Increased, justified. One focused regression spec covers both sides of the spacing rule.
There are no exceptions or follow-ups.
🤖 Generated with Claude Code