title: Angular 12 CSS optimization inline event handler with Content Security Policy
body: <p>After upgrading to Angular 12 my Content Security Policy blocks styles from loading correctly.</p>
  <p>The Angular 12 devkit seems to add a new inline event handler to the CSS bundle reference in index.html, example below.</p>
  <pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;styles.5951e4ca367b697db091.css&quot; crossorigin=&quot;anonymous&quot; integrity=&quot;sha384-2031E8+oC87S0N7NzRGcF8fqx777KEJOgQ3KcUN4aX6xsR3BVaV5sh4fibR5joOc&quot; media=&quot;print&quot; onload=&quot;this.media='all'&quot;&gt;
  
  </code></pre>
  <p>Error</p>
  <pre><code>Refused to execute inline event handler because it violates the following Content Security Policy directive...
  </code></pre>
  <p>This seems to be related to this RFC: <a href="https://github.com/angular/angular-cli/issues/18730" rel="noreferrer">https://github.com/angular/angular-cli/issues/18730</a> but I can't find any more information about how to use it with a strict (no 'unsafe-inline') CSP.</p>