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.

[Typography] Improve handling of spacing

See original GitHub issue

Hi! I was upgrading to 3.x.x and noticed that Typography now has paragraph prop and thought I’d share why it might not satisfy the most common scenarios fully.

Based on use-cases in our projects so far, we’ve created a thin wrapper around Typography which allows us to apply custom bottom margins. We accept 3 values for the bottom margin (we override gutterBottom for this purpose) - small, medium and large equal to one, two and three spacing units.

The large bottom margins gets applied to headings in various scenarios where we want to create more spacing between heading text and content of a page section. Some examples: page header, or a custom modal.

The medium one provides spacing equal to the one provided by paragraph prop and is used for the same purpose, with minor distinction - we also apply it to small headings to create spacing between the heading and paragraph text, in which case it would be wrong to add a paragraph prop to a heading because that’s not what it is.

Lastly, the small bottom margin is useful for where gutterBottom would be used.

I was wondering whether you’d be open to discussing how to address the use-cases. We try to minimize the number of places where styles need to be custom and injected to a component, and so being able to build simple layouts of heading + text without writing a line of styles has rather great value to us.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
maciej-gurbancommented, Oct 26, 2018

Apologies for not being clearer.

What I’m saying is that since we provide gutterBottom and paragraph to provide certain marginBottom, perhaps it would be worth looking into what the most common uses cases are. Our teams use MUI heavily, and providing these 3 types of bottom spacing was very useful in minimizing custom styling work needed for simple layouts involving Typography.

I’m asking whether you think providing something like gutterBottom with small, medium, large would work for general userbase of this MUI.

2reactions
oliviertassinaricommented, May 31, 2019

@KyruCabading It’s already exposed. It doesn’t require a wrapper, you can target the CSS class name or use theme.overrides.MuiTypography.gutterBottom.

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 kerning tips for improving your typography - 99Designs
Tracking is the overall spacing between groups of letters. Leading is the vertical spacing between lines of type. It's important to make the...
Read more >
The Designer's Guide to Letter-Spacing - Webdesigner Depot
It's a common practice when a font size is lower than 13px to increase the space between letters to make it legible. But...
Read more >
A Quick Guide to Tracking (Letter-spacing) in Typography
Firstly, when tracking is increased it can improve the readability of text. Letters and words are more visually distinguished from each other, allowing...
Read more >
10 simple kerning tips to improve your typography - Dribbble
If you want to start leveling-up your typography, you've got to know how to properly kern your letters. Kerning refers to the spacing...
Read more >
Building a design system — where to start? - UX Collective
Line spacing as a % should actually increase with smaller font sizes. This is because smaller fonts are already more difficult to read,...
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