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

doc: maintain font size in narrow windows #15436

Closed
wants to merge 1 commit into from
Closed

doc: maintain font size in narrow windows #15436

wants to merge 1 commit into from

Conversation

larsch
Copy link

@larsch larsch commented Sep 16, 2017

In Firefox (55 at least), this CSS rule triggers when the browser window
is placed on the left/right half of the screen. This makes the font size
to triple in size even on a desktop.

Before:

before-narrow

After: (navigation pane is still collapsed, but font size is constant)

after-narrow

Checklist
Affected core subsystem(s)

In Firefox (55 at least), this CSS rule triggers when the browser window
is placed on the left/right half of the screen. This makes the font size
to triple in size even on a desktop browser.
@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Sep 16, 2017
@BridgeAR
Copy link
Member

@lpinca would you mind taking a look? You changed this part the last time in d2577de.

@lpinca
Copy link
Member

lpinca commented Sep 20, 2017

It seems I did it in 662a561 to address this @silverwind's comment.

Originally it used 2.4em instead of 3.5em. I have no way to test this on Android, I'm sorry.

@BridgeAR
Copy link
Member

I just tested it in the Chrome dev tools by emulating cellphones and I think the size should stay like that for phones. So I am not to sure about this fix.

@nodejs/documentation what do you think?

@larsch would you mind checking this on your phone as well and see if you find a fix that does not impact the phone size that much?

@silverwind
Copy link
Contributor

silverwind commented Sep 22, 2017

A possible alternate fix could be to set max-width: 512px, which covers all current phones in terms of CSS width. BTW, you don't really need to test this on real phones. Browsers correctly set orientation based on the window aspect ratio.

@BridgeAR
Copy link
Member

Ping @larsch

@larsch
Copy link
Author

larsch commented Sep 28, 2017

Agreed, this fix is not perfect on Android. Below is the before and after screenshots.

I've tried changing the threshold to 512px which does still work on my Android. But, then the side bar doesn't disappear on desktop - which is actually quite nice.

I've been search around a bit, and the most concrete recommendation I've found is actually to use CSS pixels rather than em units for size specification. It's in this google document:

https://developers.google.com/speed/docs/insights/UseLegibleFontSizes

I've tried change it around it, but can't seem to find a solution that keeps everything well proportioned on both desktop and mobile. When I change to px, desktop is fine, but on mobile pre-blocks gets very small - just like when removing the font-size: 3.5em like I did originally.

Before change:

screenshot_20170928-173439

After change:

screenshot_20170928-173523

@BridgeAR
Copy link
Member

@larsch to me it sounds like a good thing if the sidebar does not disappear anymore on desktops. So that sounds like the best solution so far.

@silverwind
Copy link
Contributor

Our font-size definitions are very messy in general. I'll see if I can clean this up.

@silverwind
Copy link
Contributor

See #15660 for my cleanup.

@silverwind
Copy link
Contributor

silverwind commented Oct 10, 2017

Landed my PR in 6d9654b, which makes this one obsolete.

@silverwind silverwind closed this Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants