1
votes

I work with a application angular 4 and p-fileUpload component.

I want to change the background-color of component and the color of label text.

I try to change the style in a css file but it doesn't work

.ui-button.ui-fileupload-choose.ui-widget.ui-state-default.ui-corner-all.ui-button-text-icon-left{
 background-color: #3F51B5 !important;
    border: 3px solid #3F51B5 !important;
    color: #d30e0e !important;
}

However the generated code in html is:

<span class="ui-button ui-fileupload-choose ui-widget ui-state-default ui-corner-all ui-button-text-icon-left" ng-reflect-klass="ui-button ui-fileupload-choose" ng-reflect-ng-class="[object Object]">
            <span class="ui-button-icon-left fa fa-plus" ng-reflect-klass="ui-button-icon-left fa" ng-reflect-ng-class="[object Object]"></span>

What the problem ? Is it possible ?

Thanks a lot

1
Better to add HTML markup along with your css code. - Denish
span.ui-button doesn't work - lg0173
ok good ... ng-deep ... I have forgotten thanks a lot - lg0173
Also, this one, although you are not using for AM, it's the same solutions :) : stackoverflow.com/a/46770809/5468463 - Vega

1 Answers

2
votes

Consider adding the CSS you want to overwrite in the global styles.css file located in the root of your project instead of the component CSS file.