Line-height is extremely large on a few elements after responsive typography update
See original GitHub issueWhen we merged this PR, we ended up with a couple of elements that suddenly had very large line-heights. See here and here for screenshots.
In looking at these examples, it looks like the “extra tall” components are all specifying a lineHeight={18}
prop, like this:
<Serif mb={1} size="3t" color="black100" lineHeight={18}>
Country
</Serif>
I suspect that this broke when we updated the styled-system dependency - we noticed similar issues in the development of #1531, where it seemed to switch from a default of pixels to a default of ems.
We should either add back support for lineHeight={18}
, or update these elements to specify lineHeight="18px"
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to Tame Line Height in CSS
We will need some content, so let's an create an <h1> tag with some text and set the line-height to something obnoxiously huge,...
Read more >line-height - CSS: Cascading Style Sheets - MDN Web Docs
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.
Read more >Don't Use a Fixed Line Height | Aleksandr Hovhannisyan
The ideal line height for text depends on a variety of factors. In practice, this means that you'll need more line heights than...
Read more >Why can't I decrease the line-height of this text? - Stack Overflow
Try adjusting the line height both higher and lower and run the updated fiddle after each change, and you'll see what I mean....
Read more >The elements of responsive typography - LogRocket Blog
As we mentioned earlier, there are some accessibility issues with viewport units since they are not affected by changing the browser base font...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In these examples,
line-height
is being used to adjust the height of the label, to match theline-height
set by the other input fields. They are different, because…Most input fields on the forms use the
<Input>
component - which uses the Garamond s17 font specified in src/assets/fonts.tsx for the label. That gives them a line height of 1.1em.These one-off fields render a
<Serif>
component for the label. They specifysize="3t"
, which gives them a matching font-size, but a non-matching line-height (20px instead of 18px).I’m going to change these three examples to specify line-height of “1.1em”, to match the
<Input>
component labels more precisely.This was fixed a while back. Gonna close the issue.