Does anyone know how can I change mat-spinner color in Angular Material? Overriding css doesn't work. I tried changing color in material files but they can only be imported, I can't change anything there. I want it to be my custom color, not color from prebiult-themes.
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Adding a timeout to a render function in ReactJS
- How to update placeholder text in ng2-smart-table?
-
Why does the box-shadow property not apply to a
Color is build in.
Theming The color of a progress-spinner can be changed by using the color property. By default, progress-spinners use the theme's primary color. This can be changed to 'accent' or 'warn'.
https://material.angular.io/components/progress-spinner/overview
example
Use this code for ** < mat-spinner >** add this code in your .css file
In case you guys want to customize each spinner on your webpage. You can do it this way:
And now on mat-spinner add class:
And in css file:
That was what I wanted to achieve. I suppose if you look for this question you probably want the same.
This answer will work for those who're looking for a flexible solution in Angular 4 / 6 / 7. If you wan't to change the color of a mat-spinner at a component level, you'll need to use the
::ng-deep
selector. Knowing this, the solution is quite easy..uploader-status
css class encapsulates the component. You could just use::ng-deep
without using a class but then whatever changes you're doing to the mat-spinner will appear in other areas of the application. Check this to learn more.Late to the game, but this worked well in my
.scss
file today...