简体   繁体   English

在angular2中使用primeng时覆盖默认样式

[英]Overwriting the default style while using primeng in angular2

I am building an application using angular2 webpack. 我正在使用angular2 webpack构建应用程序。 I am using Primeng's datatable to display data.I am trying to change the color of the selected row. 我正在使用Primeng的数据表显示数据,我正在尝试更改所选行的颜色。 I found out that "ui-state-highlight" is the class that is getting added when the row is selected, but i am unable to override this class. 我发现“ ui-state-highlight”是选中行时要添加的类,但是我无法覆盖该类。 I tried to do it in my "global.less" but still it is not overwriting it. 我试图在“ global.less”中执行此操作,但仍未覆盖它。 could some one help me out with this. 有人可以帮我这个忙吗?

Just add !important after any css rule you wish to override: 只需在要覆盖的任何CSS规则后添加!important即可:

eg: 例如:

.ui-state-highlight{
    background-color: salmon !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM