-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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: rewrite font sizes, add viewport meta #15660
Conversation
cac3c18
to
994dee1
Compare
994dee1
to
675777e
Compare
Looks great for me on desktop, also when resizing the window. Monospace font is strangely small on Chrome on Android (same problem i had with my attempts). Everything is small on Firefox on Android. Screenshots below. Android, Chrome, silverwind:doc-font-sizes:Android, Chome, current nodejs.org:Android, FireFox, silverwind:doc-font-sizes:Android, FireFox, current nodejs.org: |
Try clearing your browser cache on Android, you might not be getting the updated CSS file. |
I believe I have done that now, but with same result. Server log claims to have sent full .css to mobile. |
@larsch: it works flawlessly on my Android 7. Try deleting your build files, IIRC there's some kind of bug where they are not refreshed sometimes: rm -rf out/doc/api && make doc-only && http-server out/doc/api And if you're on mobile Chrome, make sure to clean your cache in the privacy settings. |
pre, tt, code, .pre, span.type, a.type { | ||
font-family: Monaco, Consolas, "Lucida Console", monospace; | ||
font-size: .9em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No rem
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the one place where em
is needed so it does not dramatically downsize code
tags inside headings (which can be up to 2rem
, and a .9rem
code tag would look very bad in them).
@silverwind: Deleting the build files did the trick. Now it looks good on my Android too! |
Preview available at http://node.refack.com.s3.amazonaws.com/index.html |
will try to review soon, assigning to try and remember |
@lpinca fixed, thanks: beforeafter |
@lpinca fixed, I restored the old font size. It looked okay with 1rem to me, but I guess it makes more sense to have it smaller. beforeafter |
Did some more minor tweaks, latest version here: https://silverwind.io/api/ I'll likely land this tomorrow unless there are objections. |
This makes the docs much more mobile-friendly by adding a viewport meta tag which makes mobile browers properly scale fonts. Additionally the font sizes have been cleaned up to use `rem` units where possible. Also included are some fixes for the version dropdown. PR-URL: #15660 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Thanks. Landed in 6d9654b. |
This makes the docs much more mobile-friendly by adding a viewport meta tag which makes mobile browers properly scale fonts. Additionally the font sizes have been cleaned up to use `rem` units where possible. Also included are some fixes for the version dropdown. PR-URL: nodejs/node#15660 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix a line-height issue introduced in nodejs#15660 where paragraphs containing <code> blocks would have unequal line heights. Fixes: nodejs/nodejs.org#1399
Fix a line-height issue introduced in #15660 where paragraphs containing <code> blocks would have unequal line heights. Fixes: nodejs/nodejs.org#1399 PR-URL: #16200 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This makes the docs much more mobile-friendly by adding a viewport meta tag which makes mobile browers properly scale fonts. Additionally the font sizes have been cleaned up to use `rem` units where possible. Also included are some fixes for the version dropdown. PR-URL: #15660 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix a line-height issue introduced in #15660 where paragraphs containing <code> blocks would have unequal line heights. Fixes: nodejs/nodejs.org#1399 PR-URL: #16200 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This does not land cleanly in v6.x LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc
Rewrote pretty much all font size definitions in the docs CSS. The
viewport
meta lets mobile browsers know the site is mobile-ready, which made most of the font size hacks obsolete.I converted most
em
units torem
because cascaded font sizes can lead to unwanted surprises. I retained a 90% size on monospace fonts because they appear to be more in-line with the variable width font. I also resolved a few issues that I've noticed surrounding the version selection dropdown, and one issue of a heading layout overflow.Screenshots at various widths:
Obsoletes: #15436