fix(navbar): emit typed zero for --navbar-offset so length calc() consumers stay valid - #2146
Merged
Merged
Conversation
…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.
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
🎉 This PR is included in version 3.23.4 🎉 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.
Summary
.app-shell-activeset--navbar-offset: 0(bare unitless zero) at md+. Any consumer substituting it into a length-typedcalc()— including Hinode's own.toc-sidebarrules (top: calc(var(--navbar-offset) + 1rem),max-height: calc(100vh - var(--navbar-offset))) — producescalc(0 + <length>), which fails calc type-checking and makes the declaration invalid at computed-value time:topcomputes toauto(sticky silently dies) andmax-heighttonone. Avar()fallback does not rescue IACVT.Changes:
--navbar-offset: 0→0remon.app-shell-active, with the mechanism recorded in the adjacent comment.navbar-offset-typedSass guard at the two interpolated setters (#{$navbar-offset-xs}/#{$navbar-offset}), since a site configuringnavigation.offset = 0reproduces the identical bug through that path.--bs-btn-padding-*zeros in.btn-linkare never length-calc()-consumed and remain valid as direct padding values — left unchanged.Verification
0→0rem.top: auto,max-height: none(IACVT) in all three; after: typed values (top: 16px,max-heightviewport-tracking).HUGO_PARAMS_NAVIGATION_OFFSET=0and confirmed closed by the guard.pnpm lintand template tests pass.🤖 Generated with Claude Code