Repository navigation
Keep wide logos inside the logo box on portrait templates - #189
Merged
kittendevv merged 1 commit intoNov 22, 2026
Merged
Conversation
In Minimalist Clean and Professional Modern the logo box is 140px wide, but the image was sized by height (height: 100%; width: auto; max-width: 220px). A wide logo scaled to the height of the company details came out wider than the box and covered the company name and address. A fit script did the same in the HTML view. Let the image fill its box and scale the logo inside it with object-fit: contain, and drop the fit script so the HTML view and the PDF lay out the same way. Fixes kittendevv#173 Co-Authored-By: Claude Opus 5.5 <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.
Summary
Fixes #173
On Minimalist Clean (the default) and Professional Modern, a wide logo covers the company name and details in both the PDF and the HTML view.
The logo box is 140px wide, but the image was sized by height (
height: 100%; width: auto; max-width: 220px). Scaled to the height of the company details, a wide logo (e.g. 1072×714) comes out wider than the box and spills over the text. In the HTML view a small fit script set the height in pixels withwidth: auto, which has the same effect. Slate and Nova cap the logo with fixed limits and are not affected.Changes
backend/static/templates/minimalist-clean.htmlandprofessional-modern.html:width: 100%; height: 100%) and the logo is scaled inside it withobject-fit: contain, aligned left/top. Wide logos shrink to fit; tall or small logos still match the height of the company details..brand .logorule in Professional Modern that still setmax-width: 220px.Existing installs pick this up at startup, since built-in templates are re-synced from these files into the database.
Verification
Rendered both templates with a 1072×714 logo in WeasyPrint 57.2 (the version in the Docker image):
Also compared the rendered PDF pages before and after: the overlap is gone and the logo sits next to the company details. The HTML view was not checked in a browser.
🤖 Generated with Claude Code