Skip to content

Comments

Set maximum width to 40rem across screen sizes#111

Merged
httpjamesm merged 2 commits intohttpjamesm:mainfrom
McSinyx:72ch
Apr 25, 2024
Merged

Set maximum width to 40rem across screen sizes#111
httpjamesm merged 2 commits intohttpjamesm:mainfrom
McSinyx:72ch

Conversation

@McSinyx
Copy link
Contributor

@McSinyx McSinyx commented Apr 22, 2024

Referencing GH-45: 50% is really narrow on smaller screen sizes, the maximum width should instead be calculated from the font size.

Some rules are removed to correct the bounding box size
in browser inspector and fix the overflow on the x-axis.

The now-unused div.parent is removed; please hide whitespace changes when view the diff for better clarity.

@httpjamesm
Copy link
Owner

Hmm... On smaller windows I'm seeing overflowing on the X axis on the homepage.

image

On mobile devices, the answer pages lack padding.

image

And on large devices (this is an extreme example), this version is actually narrower than the current version.

Screenshot 2024-04-22 at 19 19 44

vs

Screenshot 2024-04-22 at 19 19 58

@McSinyx McSinyx changed the title Set maximum width to 72ch across screen sizes Set maximum width to 40rem across screen sizes Apr 23, 2024
@McSinyx
Copy link
Contributor Author

McSinyx commented Apr 23, 2024

On smaller windows I'm seeing overflowing on the X axis on the homepage.

Oops, sorry, I forgot to check the home page. The style sheets are unified now.

On mobile devices, the answer pages lack padding.

Silly me, I switched to CSS variable last minute and didn't realize var doesn't work for media queries. Padding should be restored now.

And on large devices (9000x5918), this version is actually narrower than the current version.

This is expected. Re GH-45: readability is improved by shortening the line length in characters. I switched to 40rem for backward compatibility with the old home page's width, also to roughly accommodate the standard 80-column terminal output.

People with high-res display would usually enable HiDPI or adjust the font size so it should not be an issue in practice.

@httpjamesm
Copy link
Owner

There are still issues. The homepage is no longer vertically centered, probably due to the removal of the parent div.

image

@McSinyx
Copy link
Contributor Author

McSinyx commented Apr 24, 2024

You are right, and I am horribly sorry I didn't check that. The home page is vertically centered now.

Edit: huh wait, I removed body { display: flex } before to fix text wrapping when screen got narrower than around 420px. Not sure why it broke in the original style, lemme investigate a bit further. Edit: NVM GH-113 would lower that down below any realistic screen width.

McSinyx added 2 commits April 25, 2024 03:06
Some rules are removed to correct the bounding box size
in browser inspector and fix the overflow on the x-axis.
(The diff should be viewed --ignore-all-space)
@McSinyx
Copy link
Contributor Author

McSinyx commented Apr 24, 2024 via email

@httpjamesm httpjamesm merged commit e020639 into httpjamesm:main Apr 25, 2024
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.

2 participants