![](/img/trans.png)
[英]how to overwrite ng-bootstrap datepicker element.style
[英]overwrite ng-bootstrap datepicker select.style
您可以通過在您想要覆蓋的樣式值之后添加 .important 來覆蓋每個引導程序樣式。
示例引導 styles 覆蓋:
.signup-form .btn:hover, .signup-form .btn:focus {
background: #179b81 !important;
}
在你的情況下嘗試:
select[_ngcontent-c21] {
-ms-flex: 1 1 auto;
flex: 1 1 auto;
padding: 0 rem !important;
}
添加encapsulation: ViewEncapsulation.None,
在您的組件(您使用日期選擇器的地方)元數據中。
@Component({
selector: 'wrapper-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.scss'],
encapsulation: ViewEncapsulation.None,
})
這不僅適用於 datepicker,它還可以幫助您覆蓋來自任何 3rd 方庫 styles 的任何組件,類似於 ng-bootstrap。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.