Skip to content

fix(navbar): emit typed zero for --navbar-offset so length calc() consumers stay valid - #2146

Merged
markdumay merged 1 commit into
mainfrom
fix/navbar-offset-typed-zero
Aug 27, 2026
Merged

fix(navbar): emit typed zero for --navbar-offset so length calc() consumers stay valid#2146
markdumay merged 1 commit into
mainfrom
fix/navbar-offset-typed-zero

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

Summary

.app-shell-active set --navbar-offset: 0 (bare unitless zero) at md+. Any consumer substituting it into a length-typed calc() — including Hinode's own .toc-sidebar rules (top: calc(var(--navbar-offset) + 1rem), max-height: calc(100vh - var(--navbar-offset))) — produces calc(0 + <length>), which fails calc type-checking and makes the declaration invalid at computed-value time: top computes to auto (sticky silently dies) and max-height to none. A var() fallback does not rescue IACVT.

Changes:

  • --navbar-offset: 00rem on .app-shell-active, with the mechanism recorded in the adjacent comment.
  • New navbar-offset-typed Sass guard at the two interpolated setters (#{$navbar-offset-xs} / #{$navbar-offset}), since a site configuring navigation.offset = 0 reproduces the identical bug through that path.
  • Sweep of other bare-zero custom properties: the two --bs-btn-padding-* zeros in .btn-link are never length-calc()-consumed and remain valid as direct padding values — left unchanged.

Verification

  • exampleSite rebuilt before/after: the only compiled-CSS diff is 00rem.
  • Playwright repro against the real compiled bundles in Chromium, Firefox, and WebKit — before: top: auto, max-height: none (IACVT) in all three; after: typed values (top: 16px, max-height viewport-tracking).
  • Config-path hazard reproduced with HUGO_PARAMS_NAVIGATION_OFFSET=0 and confirmed closed by the guard.
  • pnpm lint and template tests pass.

🤖 Generated with Claude Code

…sumers stay valid

.app-shell-active set --navbar-offset: 0 (bare, unitless) at md+. Consumers
substitute this custom property into length calc()s (.toc-sidebar's
top/max-height), and a bare 0 fails calc() type-checking there, making the
declaration invalid at computed-value time (top/max-height silently revert
to auto/none). Emit 0rem instead so substitution stays valid.

Also guard the two Sass-interpolated setters (--navbar-offset: #{...}) with
a small helper that coerces a unitless zero from site config
(navigation.offset/offsetXS) into 0rem, closing the same hole for
configs that supply a bare 0.
@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit 5e0552d
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a90618c45b3b800083d917c
😎 Deploy Preview https://deploy-preview-2146--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markdumay
markdumay merged commit 91016fa into main Aug 27, 2026
17 checks passed
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.23.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@markdumay
markdumay deleted the fix/navbar-offset-typed-zero branch August 27, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant