fix: scope the sidebar styles so they stop breaking breadcrumbs - #274
Merged
Conversation
The breadcrumb trail added in #272 rendered broken: styles.scss had a bare `nav { ... }` rule for the sidebar, so it applied to the breadcrumb <nav> too. Three rules matched it: nav position: fixed; top: 0; flex-direction: column; ... nav a display: flex; padding; border-bottom; border-left; ... nav a::before content: '›' So the trail was pinned to the top-left of the viewport, its two links stacked vertically, each with a '›' prefix and sidebar borders. The selector encoded an assumption that the sidebar is the only <nav> on the page. Fixed at the root rather than by piling on overrides: - `nav` -> `.sidebar-nav`, and `.sidebar nav` -> `.sidebar .sidebar-nav` for the Swal popup variant - Sidebar() renders <nav className="sidebar-nav mobile-hidden"> Declarations are untouched: the diff renames selectors only, so the sidebar's styling is byte-identical in both render paths. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Fixes the breadcrumb trail from #272, which shipped visually broken. My fault: I verified that PR by CSS reasoning instead of rendering it.
Cause
styles/styles.scsshad a barenav { … }rule for the sidebar, so it also matched the breadcrumb<nav>. Three rules applied to it:.recipe-gallery-top-nav .breadcrumbs(specificity 0,2,0) won fordisplay,align-itemsandgap, but everything it didn't set was inherited fromnav— includingposition: fixed,top: 0andflex-direction: column. Andnav astyled each crumb as a sidebar menu item.Net effect: the trail was pinned to the top-left of the viewport, its two links stacked vertically, each carrying a
›prefix and sidebar borders.Fix
The bare selector encoded an assumption that the sidebar is the only
<nav>on the page. Fixed at the root rather than by piling overrides onto.breadcrumbs:nav→.sidebar-nav.sidebar nav→.sidebar .sidebar-nav(the Swal-popup variant of the same element)Sidebar()renders<nav className="sidebar-nav mobile-hidden">2 files, +5 / −3. Breadcrumb markup and CSS are untouched.
Verification
Ran the same selector query against the built stylesheet before and after:
Regression check on the sidebar, which is what this change could break:
git diff styles/styles.scssshows 0 changed declaration lines — selectors renamed only. All nine sidebar rules are present in the built CSS under.sidebar-nav, includinga::before { content: "›" },a.recipe-gallery, and the.sidebar .sidebar-navpopup override.Sidebar()is the single component used by both the inline sidebar and the Swal popup (utils/sidebar.tsx), so both paths get the class.bun run lintandbun run buildpass.Please eyeball it
I have no browser tooling in this session, so this is verified by cascade analysis, not by rendering — the same gap that let #272 through. Worth a look at a recipe page (top nav at desktop and mobile) plus the sidebar in both forms before merging.
🤖 Generated with Claude Code