fix: resolve navbar logo and title collapsing on theme toggle - #704
Open
sanketkokate712 wants to merge 1 commit into
Open
fix: resolve navbar logo and title collapsing on theme toggle#704sanketkokate712 wants to merge 1 commit into
sanketkokate712 wants to merge 1 commit into
Conversation
The Podman logo image and 'podman' title text in the navbar were visually collapsing into each other when toggling between light and dark modes. This happened because the logo container and its img element had no explicit width constraints, causing a brief layout reflow during the theme switch. Changes to src/css/main.css: - Set explicit width (6.57rem), min-width, and min-height on .navbar__logo to lock its dimensions and prevent collapse during re-renders - Add width: 100%, height: 100%, aspect-ratio: 266/253, and object-fit: contain on .navbar__logo img so the image always fills its container stably - Add min-height on .navbar__brand to prevent the brand wrapper from shrinking - Add smooth CSS transitions (0.4s ease) on opacity, color, background, and filter for a polished theme switch experience - Use will-change: opacity on the logo img to hint the browser to optimize the transition Fixes: containers#702 Signed-off-by: sanketkokate712 <sanketkokate712@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #702 by stabilizing the navbar brand area during light/dark theme toggles, preventing the Podman logo and title from temporarily collapsing into each other due to layout reflow.
Changes:
- Adds fixed sizing constraints to
.navbar__logo(and corresponding sizing rules for the containedimg) to prevent width/height collapse during theme switches. - Adds minimum height + alignment tweaks for
.navbar__brandto keep the brand wrapper stable. - Adds color/background transition effects to make theme switching visually smoother.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+68
to
71
| .navbar__brand { | ||
| min-height: 6.25rem; | ||
| align-items: center; | ||
| } |
Comment on lines
+58
to
+66
| .navbar__logo img { | ||
| height: 100%; | ||
| width: 100%; | ||
| aspect-ratio: 266 / 253; | ||
| object-fit: contain; | ||
| display: block; | ||
| transition: opacity 0.4s ease, filter 0.4s ease; | ||
| will-change: opacity; | ||
| } |
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 #702
The Podman logo image and podman title text in the navbar were visually collapsing into each other when toggling between light and dark modes. This happened because the
.navbar__logocontainer and itsimgelement had no explicit width constraints, causing a brief layout reflow during the theme switch.Changes
All changes are in
src/css/main.css:.navbar__logo- Set explicitwidth: 6.57rem,min-width: 6.57rem,min-height: 6.25rem, andflex: 0 0 autoto lock its dimensions and prevent collapse during re-renders.navbar__logo img- Addedwidth: 100%,height: 100%,aspect-ratio: 266/253,object-fit: contain, andwill-change: opacityso the image always fills its container stably.navbar__brand- Addedmin-height: 6.25remandalign-items: centerto prevent the brand wrapper from shrinking.navbar- Added smooth CSS transition (0.4s ease) on background properties.navbar__titleand.navbar__brand- Added smooth color transitions (0.4s ease) for a polished theme switch experienceTesting