feat(sidebar): add logo-height argument to size the brand logo#1978
Merged
Conversation
Mode A sidebars render the brand logo and logomark via assets/image.html without an explicit height, so they must be sized in CSS. Add an optional `logo-height` argument (pixels) that is passed through to the image partial as `image-height`, letting the logo and logomark carry proportional height/width attributes and derive their width from the aspect ratio — mirroring how the navbar consumes `navigation.logo-height`. Backward compatible: when `logo-height` is omitted the argument is nil and the brand images render exactly as before (no image-height, CSS-driven). Co-Authored-By: Claude Opus 4.8 <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.15.0 🎉 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
Mode A sidebars (
level-max = 1) render the brand logo and logomark throughassets/image.htmlwithout an explicit height, so downstream themes must size them in CSS. This adds an optionallogo-heightargument (pixels) to thesidebarpartial, forwarded to the image partial asimage-height.With it set, the logo and logomark carry proportional
height/widthattributes and derive their width from the aspect ratio — mirroring how the navbar consumesnavigation.logo-height, so a shell-mode sidebar brand can match the navbar logo without hand-tuned CSS.Changes
data/structures/sidebar.yml— register the optionallogo-heightargument._partials/assets/sidebar.html— readlogo-heightand pass it asimage-heightto both the full logo and the logomark.Backward compatibility
When
logo-heightis omitted the argument is nil, soimage-heighthas no effect and the brand images render exactly as before (CSS-driven). Existing sidebars are unaffected.🤖 Generated with Claude Code