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

x/tools/cmd/godoc: some line-heights became less readable #27321

Open
beaubrueggemann opened this Issue Aug 28, 2018 · 3 comments

Comments

Projects
None yet
5 participants
@beaubrueggemann

beaubrueggemann commented Aug 28, 2018

https://go-review.googlesource.com/c/tools/+/94935 changed some line-height values in godoc/static/style.css, dropping the em unit specifier.

It appears these line-height changes weren't meant to have any visible changes. The reasoning in the CL states:

If the line-height is specified in em, you can just drop the em (it's the default unit for line-height). So here "line-height: 1.4;" would be the right thing.

But em is not the default unit for line-height (see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height).

On my system (Arch Linux, Firefox), this results in visible changes. As an example, here are 2 screenshots. First, we have the original em behavior (taken from the index for package fmt):
original

And here is the newer behavior following the removal of the ems:
harder-to-read

The computed line-height went from 20.8px to 18.2px.

I find the original em version to be more readable. Since it looks like this visible change was inadvertent, could we add the em units back to lines 5 and 15?

@gopherbot gopherbot added this to the Unreleased milestone Aug 28, 2018

@kevinburke kevinburke self-assigned this Aug 28, 2018

@jimmyfrasche

This comment has been minimized.

Member

jimmyfrasche commented Aug 29, 2018

This is my fault. I gave @agnivade bad advice because I confidently mis-remembered how line-heights work and didn't notice the visual difference. Sorry!

@agnivade

This comment has been minimized.

Member

agnivade commented Aug 29, 2018

Right, there is indeed a difference. Good catch.

The MDN docs do recommend the line-height to be unitless however. https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#Prefer_unitless_numbers_for_line-height_values.

Perhaps, we can re-calculate the required line-height, and give a slightly higher number and still keep it unitless ?

@agnivade agnivade added the NeedsFix label Aug 29, 2018

@agnivade agnivade changed the title from x/tools/godoc: some line-heights became less readable to x/tools/cmd/godoc: some line-heights became less readable Aug 29, 2018

@gopherbot

This comment has been minimized.

gopherbot commented Sep 9, 2018

Change https://golang.org/cl/134224 mentions this issue: godoc: specify line-height is in em

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment