Angular Material2 theming - how to set app background?

后端 未结 10 1652
别那么骄傲
别那么骄傲 2020-12-04 14:24

I am building an angular2 app using angular material2. I am trying to set the background of my application \"the correct way\", but I can\'t figure out how.

I found

10条回答
  •  青春惊慌失措
    2020-12-04 15:05

    edit: This strategy involves replacing Material functionality. for most cases, I would recommend Jake Stoeffler's answer above.

    If you want to set the background colors, you likely want to customize the entire background and foreground palette by emulating the mat-light-theme or mat-dark-theme functions with your own replacement. Your replacement would include your own palettes instead of the mat-light-theme-foreground and background palettes.

    example: https://stackblitz.com/edit/angular-material-custom-background?file=theme.scss

    I don't know if this method is recommended or officially supported.

提交回复
热议问题