覆盖Angular中的primeng CSS类 [英] Override primeng css classes in Angular
本文介绍了覆盖Angular中的primeng CSS类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题是我想覆盖primeng的CSS类并更改一些颜色.不管我怎么做,它都不会改变.如果将ViewEncapsulation更改为none,则该组件甚至都不会出现.我已经尝试过这样的事情:
The thing is that I want to override the CSS classes of primeng and change some colors. No matter how I do it it doesn't change. If change the ViewEncapsulation to none the component doesn't even appear. I've tried something like this:
.ui-chkbox-box.ui-state-active, .ui-radiobutton-box.ui-state-active {
border: 1px solid red !important;
background: red !important;
color: #FFFFFF;
}
尝试覆盖组件css中的属性,但仍然无法正常工作.
Trying to override the properties in the component css but it still doesn't work.
我知道其他人也问过同样的问题,但是没有一个答案对我有帮助,所以我有点绝望.
I know other people have asked the same question but none of the answers has helped me so I'm a little bit desperate.
推荐答案
添加:: ng-deep
Add ::ng-deep
::ng-deep .ui-chkbox-box.ui-state-active{...}
这篇关于覆盖Angular中的primeng CSS类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文