Components: ng-add: option to set up typography styles for native elements

Created on 14 Aug 2019  路  7Comments  路  Source: angular/components

Reproduction

Steps to reproduce:

  1. create new angular app
  2. do: ng add @angluar/material
    result:
    added 3 packages from 4 contributors in 15.766s
    UPDATE src/main.ts (391 bytes)
    UPDATE src/app/app.module.ts (577 bytes)
    UPDATE angular.json (3608 bytes)
    UPDATE src/index.html (490 bytes)
    UPDATE src/styles.css (181 bytes)
  1. notice that in index.html the fonts links are added but the body tag has no class

Expected Behavior

The schematic should add class="mat-typography" to the body tag in index.html

Actual Behavior

The schematic changes the index.html to add font links but did not change the body tag

Environment

  • Angular: 8.1.1
  • CDK/Material: 8.1.1
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
P4 feature has pr help wanted

All 7 comments

In the documentation this is mentioned.

Yes you鈥檙e correct.
But the schematic does all the steps in the documentation to except this step.
And if a user is not aware of that then no typography is applied and the user wont know why.

@jelbourn Do we actually want to do this as part of ng add. How about adding an option (with prompt) for this?

Seems reasonable as a prompt in ng add.

In @angular/[email protected], this prompt is here:

? Set up global Angular Material typography styles?

but the mat-typography class is added to the body tag no matter what we answer.

猬嗭笍 @crisbeto

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._

Was this page helpful?
0 / 5 - 0 ratings