-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Improve line-height CSS #999
Conversation
Codecov Report
@@ Coverage Diff @@
## master #999 +/- ##
=======================================
Coverage 92.46% 92.46%
=======================================
Files 89 89
Lines 3200 3200
=======================================
Hits 2959 2959
Misses 241 241
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Perhaps we should add |
Yes, we should. We could also include |
Those should be |
Line height with no default varies oddly across browsers, leading to slight misalignment of elements in browsers we do not test on. Setting a proper line height also depends on the font we use and we only use system fonts in the moment, which also makes it differ across operating systems. Setting a line-height globally avoids this issue. We should be setting individual line heights to parts of code where we encounter issues as you've posted above. As of now, removing line-height has effects in other parts of the page, leading to misalignment of icons and extra leading heights for inputs. We could change We can come back to this when we do our overall styling. |
Cool, let's set a default then. But a default of From MDN:
|
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.
@seancolsen The changes look fine.
The issue with finding the correct line-height is that fonts differ on the baseline to descender distance, as well as the cap-height distance.
Currently we only use system fonts, so our font will differ based on the OS and this will also lead to subtle visual differences in positions. Usually, that wouldn't be of concern, but we have a few places where this is clearly visible.
In the screenshot, you can find the additional leading space that is introduced with line-height 1.2
. This makes the cell content appear slightly aligned to the bottom instead of center.
The clear visual difference appears when we enter and exit edit mode, causing a slight jerk in the text, as shown in the below video:
Screen.Recording.2022-01-29.at.2.08.28.AM.mov
The other place where it appears is the header images (which are temporary at this point).
I've added a commit 40e9b2a which fixes these immediately visible places. We could improve upon the css during our styling update tasks. Please take a look at the commit and feel free to merge.
@pavish I think the slight jerk in text is better than table names appearing to display underscore characters as space characters. So I'm going to merge this. If we're going to get particular about spacing, I think we ought to ship a web font to the browser. I can certainly see the appeal of using system fonts. But I'd lean towards being explicit about the font -- for the same reason we want to be explicit about the line height -- because we want predictable spacing across different platforms. |
@pavish why have we had
line-height: 1em;
set globally?That CSS has some weird effects, including making underscores nearly invisible in tab names at certain zoom settings.
Adjusting the line-height is the best way to fix that issue I think, and to me it makes the most sense to unset it globally (as this PR does).
I imagine we'll want to tweak a bunch of the typography stuff once we do our overall styling. If we do want to customizes the line height, MDN recommends always using unitless values for line-height.
Checklist
Update index.md
).master
branch of the repositoryDeveloper Certificate of Origin
Developer Certificate of Origin