0

How to change style

.p-dialog .p-dialog-footer button {
   margin: 0 1rem 0 0 !important;
   width: auto !important;
}

I write like this but it doesn't work

:host ::ng-deep .p-dialog .p-dialog-footer button {
   width: 2.5rem !important;
}

1 Answer 1

1

In the original width is declared !important. Your override then has to be !important too.

2
  • That doesn't work either Commented Jan 26, 2022 at 6:39
  • The !important was necessary, but not sufficient. One more thing I can think of: Since this is for a dialog, the dialog isn't really contained inside your :host component, even though you might be launching the dialog from there. So this change needs to be a global style (as in styles.scss). You might need to create a new class for the dialog if you don't want all dialogs to have this change.
    – kshetline
    Commented Jan 26, 2022 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.