Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TimoPot opened this issue Aug 14, 2019 · 7 comments · Fixed by #18315
Closed

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

TimoPot opened this issue Aug 14, 2019 · 7 comments · Fixed by #18315
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions

Comments

@TimoPot
Copy link

TimoPot commented Aug 14, 2019

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)

  3. 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
@Totati
Copy link
Contributor

Totati commented Aug 14, 2019

In the documentation this is mentioned.

@TimoPot
Copy link
Author

TimoPot commented Aug 14, 2019

Yes you’re 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.

@devversion
Copy link
Member

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

@devversion devversion changed the title class="mat-typography" not added to <body> in index.html ng-add: option to set up typography styles for native elements Aug 15, 2019
@jelbourn
Copy link
Member

Seems reasonable as a prompt in ng add.

@jelbourn jelbourn added feature This issue represents a new feature or feature request rather than a bug or bug fix help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions and removed discussion labels Aug 15, 2019
@crisbeto crisbeto self-assigned this Nov 4, 2019
@crisbeto crisbeto added the has pr label Nov 4, 2019
@LayZeeDK
Copy link
Contributor

LayZeeDK commented Jan 27, 2020

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.

@LayZeeDK
Copy link
Contributor

⬆️ @crisbeto

crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 28, 2020
In angular#17602 a new prompt to `ng-add` was added which allowed consumers to opt into adding the `mat-typgoraphy` style globally, but it looks like the option was never read so the class is always being added.

Fixes angular#16776.
jelbourn pushed a commit that referenced this issue Jan 28, 2020
In #17602 a new prompt to `ng-add` was added which allowed consumers to opt into adding the `mat-typgoraphy` style globally, but it looks like the option was never read so the class is always being added.

Fixes #16776.
jelbourn pushed a commit that referenced this issue Jan 28, 2020
In #17602 a new prompt to `ng-add` was added which allowed consumers to opt into adding the `mat-typgoraphy` style globally, but it looks like the option was never read so the class is always being added.

Fixes #16776.

(cherry picked from commit 290d102)
yifange pushed a commit to yifange/components that referenced this issue Jan 30, 2020
…18315)

In angular#17602 a new prompt to `ng-add` was added which allowed consumers to opt into adding the `mat-typgoraphy` style globally, but it looks like the option was never read so the class is always being added.

Fixes angular#16776.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants