Angular 5+.
Angular CLI 1.7.4
Followed the setup here: https://material.angular.io/guide/getting-started
How I implemented material icons: https://stackoverflow.com/a/48281556/1052888
I can get some icons to show but there are inconsistencies. For example, this:
<button mat-icon-button>
<mat-icon aria-label="Edit dashboard">bug report</mat-icon>
</button>
yields (blue outline on click shows just how off center it is):
When I click the pencil, the animated circle shows in the square part of the outline which upon inspection is the area of the button
tag.
I'm not adding any additional styling at this point to cause this behavior.
I have also turned off Bootstrap to see if that was causing conflicting issues.
This one renders correctly:
<button mat-icon-button>
<mat-icon aria-label="Edit dashboard">build</mat-icon>
</button>
yields (All the icons should be centered like this):
What I mean by centered is that I think they should be centered within the button
tag like the build
icon:
Some icons don't display at all:
<button mat-icon-button>
<mat-icon aria-label="Edit dashboard">aspect ratio</mat-icon>
</button>
yields:
And yes, aspect ratio
is listed as an icon on the Angular Material https://material.io/icons/
The blue line on click can be handled with span styling. Bootstrap is causing this.
The console reports a warning that not all material components may work correctly if a theme is present so I was sure to import into angular-cli:
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/material-design-icons/iconfont/material-icons.css",
"../node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
],
Update:
I guess the icons are simply broke. on the Angular Material site itself, here, I changed the middle heart (favorite) to display the edit mode
icon. The layout issue occurs here as well as certain icons not showing: