SonarQube - ::ng-deep getting an error as "Unexpected unknown pseudo-element selector ::ng-deep"
Asked Answered
B

1

6

In ourproject , we have used angular material for development. We have overridden the angular material styles using ::ng-deep to customize the CSS properties.

While using ::ng-deep getting an error as "Unexpected unknown pseudo-element selector ::ng-deep" in sonar report.

enter image description here

Prior to ::ng-deep team tried to override the properties using parent classes ( mat-input-underline.mat-form-field-underline ) and by using customstyle.scss file but It didn't work as expected.

Just curious to know whether there is any alternate solution for this issue or shall we skip this rule in our sonar metrics. Any one please advise on this ?

Reference

What to use in place of ::ng-deep

Buckbuckaroo answered 15/5, 2020 at 19:26 Comment(0)
H
0

Best I could figure out was ViewEncapsulation.none and then using app-component-name {} to prevent all the css from bleeding out

Holman answered 26/5, 2021 at 15:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.