Angular2+ (9) Content Security Policy - How to address unsafe-inline styles?

Viewed 174

This is regarding Content-Security-Policy, trying avoid using 'unsafe-inline' styles. So, I've added the below meta tag to test the application.

 <meta http-equiv="Content-Security-Policy"
      content="default-src 'self'; style-src 'self' ; img-src 'self' ">

Angular does add inline styles for components. Consolidating all component styles into a global style sheet did not help. As the global style sheet also added to the inline in the index.html page.

Anyone has as any suggestions/approach to the avoid using the inline styles please ? Or

Perhaps Angular did think about that and they're good at sanitizing css,scripts etc.. so we do not need to worry about this ?

0 Answers
Related