Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Disallow header wrapping CSS #8134

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Conversation

holloway
Copy link
Contributor

@holloway holloway commented Nov 3, 2024

Although it's rare for header nav items to wrap they can and this would overlap and obscure page content. This only occurs on the desktop responsive mode. This one-liner fix prevents wrapping because our layout doesn't support wrapping anyway. This fixes #7920.

screenshot from #7920 where a user triggered this bug
header

In the following screenshots I modified the template to add the text "wrapping" to trigger the bug more easily.

before the fix
Screenshot from 2024-11-03 11-06-22

after the fix
Screenshot from 2024-11-03 11-06-00

The header (<nav>) and page content (<main>) are in separate CSS flow layouts because the header is position:fixed so when the header wraps it can't push the page content down. They only appear to be adjacent due to the navbar-offset CSS on <body>.

This wrapping bug can be caused in several ways

  1. a narrow browser width or zoom level to be in desktop responsive mode and nearly in mobile mode. The zoom level is more than 175% and less than 200%, so around 180%.
  2. a long username (username text appears in the header so longer text will cause wrapping)
  3. OS font rendering that's slightly wider than usual.

This CSS fix could cause horizontal scrolling but it doesn't for me, and that seem preferable to obscuring the page content.

I considered another approach to allow wrapping and use JS to measure the height of the header (repeatedly as the user may resize their browser) and use the header height to set the navbar-offset but that seemed unnecessarily complicated.

You may be asking yourself whether this is a lot of text for a one-liner fix, and yes — yes it is. You're welcome.

@rjsparks rjsparks merged commit deb58a1 into ietf-tools:main Nov 3, 2024
6 of 7 checks passed
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.

Datatracker menu covers draft name in Chrome
4 participants