Angular Material mat-spinner custom color

后端 未结 15 1572
慢半拍i
慢半拍i 2021-01-07 16:11

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

15条回答
  •  终归单人心
    2021-01-07 16:52

    I think the key here is that is must be in the GLOBAL styles.css file. The below solution does work if placed there (should be the CSS file affected when material was added to the project if added with ng add:

    .mat-progress-spinner circle, .mat-spinner circle {
        stroke: #b68200;
    }
    

    Of course you could also add classes to the component and specify different selectors if you want distinctly styled spinners. However, it seems the classes must be in the global CSS file.

提交回复
热议问题