![](/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.