Skip to content

fix: constrain header containers at wide viewports (#47)#52

Merged
jacaudi merged 1 commit into
mainfrom
fix/wide-viewport-header
Apr 11, 2026
Merged

fix: constrain header containers at wide viewports (#47)#52
jacaudi merged 1 commit into
mainfrom
fix/wide-viewport-header

Conversation

@jacaudi
Copy link
Copy Markdown
Owner

@jacaudi jacaudi commented Apr 11, 2026

Summary

Closes #47. At viewports wider than 1080px, #logo_container and #chiz_container were both position: fixed; width: 25%, anchoring the logo to the far-left edge and the icons/menu to the far-right edge. At 1150px this created ~575px of dead space; wider screens made it worse.

Change

CSS-only, no HTML template change.

Base rule (src/css/styles.css):

  • #logo_container, #chiz_container: width: 25%width: auto; left: 25%; right: 25%
    Both containers now span the central 50% of the viewport, matching #main_container's padding: 25% 0.
  • #logo_container: align-items: flex-start so the logo anchors to the left edge of that central strip.
  • #chiz_container: removed right: 0 (set on base now); justify-content: flex-end already anchored icons to the right edge.

Narrow viewport override (@media (max-width: 1080px)):

  • #logo_container: left: 0; right: auto — reverts to full-width / left-anchored.
  • #chiz_container: left: auto; right: 0 — reverts to right-anchored.

Without these explicit overrides, the new base left: 25%; right: 25% would cascade into mobile/tablet and break them.

Why this preserves mobile and tablet

At ≤1080px the narrow-viewport media query resets left/right to the originals, so #logo_container goes back to width: 100vw; left: 0 and #chiz_container goes back to right: 0 with its content-sized width. The ≤800px portrait rules only touch top, unaffected.

Dark mode is unaffected — only positioning properties changed; no color or background rules touched.

Test plan

  • Full Node.js suite: 133 pass / 0 fail
  • Math verified at 375px, 768px, 1000px (narrow media query unchanged), 1150px, 1440px, 1920px (anchors to main-content edges)
  • Visual verification at 1440px (skipped by agent; recommend local check)
  • CI green

#logo_container and #chiz_container were both position:fixed; width:25%,
anchoring the logo to the far-left and the icons/menu to the far-right
of the viewport. At 1150px this created ~575px of dead space; wider
screens made it worse.

Change the base rule to width:auto; left:25%; right:25% so both
containers span the central 50% of the viewport — matching
#main_container's padding of 25% 0. Logo gets align-items:flex-start
to anchor left within that strip; chiz keeps justify-content:flex-end
to anchor right. The narrow-viewport media query (<=1080px) explicitly
resets left/right so mobile and tablet behavior is unchanged.

No dark-mode rules are affected — only positioning properties changed.

Closes #47

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jacaudi jacaudi merged commit 6ce60ce into main Apr 11, 2026
13 checks passed
@jacaudi jacaudi deleted the fix/wide-viewport-header branch April 11, 2026 07:12
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.

Wide-viewport header layout: logo and icons spread to viewport edges

1 participant