Skip to content

mat-fab, mat-mini-fab have no mat-accent class in production #9253

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

Closed
PeS82 opened this issue Jan 17, 2018 · 4 comments
Closed

mat-fab, mat-mini-fab have no mat-accent class in production #9253

PeS82 opened this issue Jan 17, 2018 · 4 comments

Comments

@PeS82
Copy link

PeS82 commented Jan 17, 2018

Versions

Angular CLI: 1.6.3
Node: 8.9.0
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/cdk: 5.0.4
@angular/cli: 1.6.3
@angular/flex-layout: 2.0.0-beta.12
@angular/material: 5.0.4
@angular-devkit/build-optimizer: 0.0.38
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.13
@schematics/schematics: 0.0.11
typescript: 2.5.3
webpack: 3.10.0

Repro steps

Source

<button [routerLink]="['/new']" mat-mini-fab class="ml" matTooltip="Add new customer"><mat-icon>add</mat-icon></button>

With ng serve, ng serve --aot, ng build --aot this produces:

<button class="ml mat-mini-fab mat-accent" mat-mini-fab="" mattooltip="Add new customer" tabindex="0" ng-reflect-router-link="/new" aria-describedby="cdk-describedby-message-3" cdk-describedby-host="" ng-reflect-message="Add new customer"><span class="mat-button-wrapper"><mat-icon class="mat-icon material-icons" role="img" aria-hidden="true">add</mat-icon></span><div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple="" ng-reflect-centered="false" ng-reflect-disabled="false" ng-reflect-trigger="[object HTMLButtonElement]"></div><div class="mat-button-focus-overlay"></div></button>

When in production, after running ng build --prod, html is:

<button class="ml mat-mini-fab" mat-mini-fab="" mattooltip="Add new customer" tabindex="0" aria-describedby="cdk-describedby-message-3" cdk-describedby-host=""><span class="mat-button-wrapper"><mat-icon class="mat-icon material-icons" role="img" aria-hidden="true">add</mat-icon></span><div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple=""></div><div class="mat-button-focus-overlay"></div></button>

Observed behavior

There is no mat-accent class in production build.

Desired behavior

There should be mat-accent class in production build.

Mention any other details that might be useful (optional)

There might be other troubles, this one was easy to spot as all fab buttons lost the background. It should be accent by default per angular/material2 docs (and it was so until recently).

It might be trouble with Material itself however filing here as it does work with other than production builds.

@dinerotah
Copy link
Contributor

dinerotah commented Jan 18, 2018

See #9221

@alexjlockwood
Copy link

Could anyone recommend a workaround for this issue?

@hansl
Copy link
Contributor

hansl commented Jan 24, 2018

Closing as dupe of #9221.

@hansl hansl closed this as completed Jan 24, 2018
@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 Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants