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

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

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

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

beaubrueggemann opened this issue Aug 28, 2018 · 3 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@beaubrueggemann
Copy link

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
Copy link
Member

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
Copy link
Contributor

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 The path to resolution is known, but the work has not been done. label Aug 29, 2018
@agnivade agnivade changed the title x/tools/godoc: some line-heights became less readable x/tools/cmd/godoc: some line-heights became less readable Aug 29, 2018
@gopherbot
Copy link

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

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants