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.

How to manage line-height per font-size?

See original GitHub issue

I have not found a means to manage line-height per font-size to achieve a vertical rhyhtm. Have I overlooked something?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
selrondcommented, Oct 9, 2017

@smarchetti that’s exactly how I was doing it. The problem is, though, that you have to remember which component you’ve extended, and which one you use as-is; and import them correctly. Thus it’d be really nice if Rebass provided something to manage line-height internally.

@jxnblk have you seen Kyle Mathews’ Typography.js? Having a global typography config for Rebass would be nice!

1reaction
smarchetticommented, Oct 17, 2017

Another idea is to use styled-system’s responsiveStyle method and mapping the theme lineHeights array to the fontSize property.

const lineHeight = responsiveStyle({ prop: 'fontSize', cssProperty: 'line-height', key: 'lineHeights' });
Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
How to Tame Line Height in CSS
Getting CSS to treat line-height like leading · $lineHeightScale · $fontSize · $lineHeight · $typeOffset · $topSpace · $heightCorrection · $topSpace · $ ......
Read more >
The ideal line length & line height in web design - Pimp my Type
For reading text, the ideal line is said to be around 60 to 80 characters long. Please know, this is not backed by...
Read more >
Choosing a suitable line height – Fonts Knowledge
Setting a line height of 150% in a design application multiplies our font size by 1.5. The exact value we should use for...
Read more >
How CSS line-height works and best practices
Setting it to any pixel value will set it to exactly this value. So if your font-size for example is 16px and you...
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