Overriding Material2 Style with Custom CSS
问题 I have Datepicker element in Angular. It is standard component from Material Design. When I try to set own styles to this element, it does not work with property !important . How to fix it, and how to change the default component's styles? Example of code: .mat-datepicker-toggle { margin-right: 10px !important; } 回答1: Another option is to set the View Encapsulation to None on your component: @Component({ templateUrl: './my.component.html' , styleUrls: ['./my.component.scss'], //or .css,