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.

Font size doesn't change row height when fxLayout="column" and using Angular Material typography

See original GitHub issue

Bug Report

I’m havig an issue when using flex layout with Angular Material, specifically angular material where the “global Angular Material typography styles” have been set.

I am setting a specific font size for texts that is displayed in rows and the rows’ heights are not correctly calculated. They behave as if they had a standard font size instead of the bigger size.

More precisely, I have a project setup with Angular Material and the body has the “mat-typography” class.

<body class="mat-typography">
  <my-app></my-app>
</body>

In an angular component’s html I have the following layout:

  <div fxLayout="row">
    <div fxLayout="column">
      <div>Hello</div>
      <div class="large">World</div>
    </div>

    <div fxFlex fxLayout="column">
      <div>Hello</div>
      <div class="large">World</div>
    </div>
  </div>

and css:

.large {
  font-size: 4em;
}

What is the expected behavior?

We should have two “Hello World” text in two columns with a small hello and a big world, the text should not overflow.

Something like that: image

What is the current behavior?

World ends up being written on top of hello:

image

What are the steps to reproduce?

Here’s a StackBlitz link for the issue: https://stackblitz.com/edit/angular-ivy-omaraf

What is the use-case or motivation for changing an existing behavior?

We should be able to use Flex layout with Angular Material global typography configured.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

I could reproduce with 11, seemingly on all browsers.

Is there anything else we should know?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Gimlycommented, Jun 16, 2021

@mackelito OK, fair enough, I’ll have to check if I can reproduce something similar removing this library from the equation…

0reactions
angular-automatic-lock-bot[bot]commented, Jul 17, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular material decrease all typography levels font-size
I use custom typography in styles.scss to decrease font-size by 2px, hence keeping line-height and weight untouched:
Read more >
Using Angular Material's Typography
Angular Material's typography is based on the guidelines from the Material Design spec and is ... Each level has a font-size , line-height...
Read more >
Angular Material Typography - how to configure? (Advanced ...
You will learn how to change font family in your custom theme and reuse some functions and scss mixins provided by material library....
Read more >
Building Beautiful Web Apps With Angular Material - Part II
Learn how you can build beautiful web apps with Angular Material - Part II. ... font-family: Roboto, sans-serif; } .app { height: 100vh; ......
Read more >
Angular Material typography sizing is inconsistent w ... - GitHub
Bug, feature request, or proposal: Angular Material does not use the same typography size ranking as the Material spec.
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