问题
/deep/ and ::ng-deep these are also deprecated in DOM mode and, i'ld like to know whether there will be an alternative in the future to /deep/ and ::ng-deep or should we start using other ways?
::ng-deep .result-container .options-section .option-radio-button .option-text p {
margin: 5px 0px !important;
white-space: pre-wrap !important;
}
回答1:
Currently there's no alternative right now, so we should all continue to use it, because it's practical.
When ViewEncapsulation.Native
is properly supported by all browsers and supports styling across shadow DOM boundaries, ::ng-deep
will probably be discontinued.
来源:https://stackoverflow.com/questions/55259593/what-is-the-long-term-alternative-solutions-to-deep-or-ng-deep