Angular Material Style Class not working

According to Official Documentation of Angular Material:

Including a theme is required to apply all of the core and theme
styles to your application.

To get started with a prebuilt theme, include one of Angular
Material’s prebuilt themes globally in your application.

You can simply add the following to your style.css in order to get it work:

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

Or you can directly include using <link> tag in your head tag.


P.S: To create your own custom built theme visit https://material.angular.io/guide/theming

Leave a Comment