How to change the scrollbar styles in Angular Material select?

前端 未结 4 1320
萌比男神i
萌比男神i 2021-02-07 19:48

We need help in changing the scrollbar in the Select component from Angular Material.

The following demo was implemented.

https://stackblitz.com/angular/bxbvndrp

4条回答
  •  轮回少年
    2021-02-07 20:43

    Because, when you using Angular one common attribute will be rendered in DOM like ng-content which will over write your class properties written in CSS, so try this code this will eliminate native Angular styles to use in application.

    Go to the Component,

    import {ViewEncapsulation} from '@angular/core';
    

    Then

    @Component({
    .....
    .....
    encapsulation: ViewEncapsulation.None
    })
    

    Then your styles will taken by browser.

提交回复
热议问题