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 gets set in em instead of unitless

See original GitHub issue

According to the docs,

baseLineHeight: The base line height using the css unitless number, defaults to 1.5.

However, line-height gets set in em units.

typography js 2018-01-19 20-17-20

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
KyleAMathewscommented, Feb 2, 2018

@dardub nah, not breaking people’s code is really important! Appreciate you helping us understand what was happening!

1reaction
sloriacommented, Jan 30, 2018

Yeah, it looks like compass-vertical-rhythm has code to remove units from baseLineHeight (which gets passed along to establishBaseline in the latest release):

https://github.com/KyleAMathews/compass-vertical-rhythm/blob/master/src/index.coffee#L96

I can make a PR when I get off of work today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does unitless line-height behave differently from ...
(Namely: a unitless value is passed to the child element and its line height is calculated using the child's font size, whereas a...
Read more >
Nope, nope, nope, line-height is unitless - Matt Smith
When setting line-height in CSS, a common mistake is to pass a specific unit for the value. Here's why we should be following...
Read more >
line-height - CSS-Tricks
Unitless line heights are recommended due to the fact that child elements will inherit the raw number value, rather than the computed value....
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 >
line-height unitless vs. em - CodePen
length and percentage line-heights have poor inheritance behavior ... Avoid unexpected results by using unitless line-height. length and percentage line-heights ...
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