Skip to content

fix: resolve navbar logo and title collapsing on theme toggle - #704

Open
sanketkokate712 wants to merge 1 commit into
containers:mainfrom
sanketkokate712:fix/navbar-logo-theme-toggle-glitch
Open

fix: resolve navbar logo and title collapsing on theme toggle#704
sanketkokate712 wants to merge 1 commit into
containers:mainfrom
sanketkokate712:fix/navbar-logo-theme-toggle-glitch

Conversation

@sanketkokate712

Copy link
Copy Markdown

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__logo container and its img element 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 explicit width: 6.57rem, min-width: 6.57rem, min-height: 6.25rem, and flex: 0 0 auto to lock its dimensions and prevent collapse during re-renders
  • .navbar__logo img - Added width: 100%, height: 100%, aspect-ratio: 266/253, object-fit: contain, and will-change: opacity so the image always fills its container stably
  • .navbar__brand - Added min-height: 6.25rem and align-items: center to prevent the brand wrapper from shrinking
  • .navbar - Added smooth CSS transition (0.4s ease) on background properties
  • .navbar__title and .navbar__brand - Added smooth color transitions (0.4s ease) for a polished theme switch experience

Testing

  • Tested locally by toggling dark/light mode multiple times
  • Logo and title remain stable with no collapsing, jumping, or flickering
  • Transitions are smooth across theme switches

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>
Copilot AI lite review requested due to automatic review settings August 17, 2026 12:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 contained img) to prevent width/height collapse during theme switches.
  • Adds minimum height + alignment tweaks for .navbar__brand to 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 thread src/css/main.css
Comment on lines +68 to 71
.navbar__brand {
min-height: 6.25rem;
align-items: center;
}
Comment thread src/css/main.css
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Navbar logo and text collapse on theme toggle

2 participants