Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing effect of ng-deep on component destroy

I hate to use ng-deep but there is no better alternative for this.

I am using VMware Clarity https://v1.clarity.design/modals in my project and for some cases, I need to overwrite modal-body class. So, I am overwriting it using this in my component.scss file:

::ng-deep .modal-body {
  overflow-y: visible;
  overflow-x: visible;
}

This serves my purpose. But the problem starts for other modals. After opening above modal, if I open any other modal, above styling affects those too. I want above styling only for one modal. So how I can do that.

I was wondering if there is an option to reset above style when the component gets destroyed or What Angular Suggests.

like image 631
undefined Avatar asked Oct 16 '25 04:10

undefined


1 Answers

You can just write your selector to be more specific so it targets only the desired modal.

<clr-modal class="overflow-modal">...</clr-modal>
::ng-deep .overflow-modal .modal-body {
  overflow-y: visible;
  overflow-x: visible;
}
like image 198
Jeremy Wilken Avatar answered Oct 17 '25 20:10

Jeremy Wilken