Angular 5 Material Snackbar panelClass config

后端 未结 4 1104
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 19:16

I am trying to add a panelClass config to the Angular Material Snackbar.

I wrote the following code, by following documentations from the official websites.

4条回答
  •  执念已碎
    2021-01-04 19:37

    panelClass is defined as

    panelClass: string | string[]

    Extra CSS classes to be added to the snack bar container.

    It is used to add a class, not a style.

    Imagine the size of the array if you had to put complex css styling in there.

    So you need to define your style in a css and only then you can apply a class to the bar:

    panelClass: ['first-class', 'second-class'];
    

提交回复
热议问题