I’ve been struggling to change the background color of the dialog based on a condition.
changeColor is the variable I am checking if true. Works for changing background color for other tags. Assuming maybe some sort of further override is required for the dialogs. All I want is some sort of overlay on it, changing the color along the lines of this.
I’ve tried inline, global css styling. Even wrapping the dialog content in a div with styling has weird behaviour.
2
Answers
If you want to change the color of the dialog content, you will need to use
styleClass
to set a class on the dialog and then style the inner elements with.p-dialog-title
,.p-dialog-content
and.p-dialog-footer
.Here’s what the code would look like.
If instead, you want to have a mask layer behind the dialog, you can set
[modal]="true"
on the dialog to have it show a transparent layer behind the dialog.You are just missing the import of the .css file into component: