question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line-height is extremely large on a few elements after responsive typography update

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pepopowitzcommented, Nov 13, 2018

In these examples, line-height is being used to adjust the height of the label, to match the line-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 specify size="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.

0reactions
zephraphcommented, Apr 17, 2019

This was fixed a while back. Gonna close the issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found