You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we are unable to hash css that gets injected at runtime.
Some common libraries that use this way of getting CSS into the DOM are styled-components, MUI and emotion.
Possible solutions to this issue could be:
Using the AST in Vite during build time to track down this CSS and hash all of it.
Use LinkeDOM a JSDOM alternative, to actually load the JS and CSS and then look for the CSS syntax in the DOM. This will be more accurate, however more heavy - especially when we have to account for lazy loading.
Using strict-dynamic inside the CSP
Any other ideas are welcome!
In the mean time an interesting blog post that argues unsafe-inline for CSS is okay under specific conditions
The text was updated successfully, but these errors were encountered:
Currently we are unable to hash css that gets injected at runtime.
Some common libraries that use this way of getting CSS into the DOM are
styled-components
,MUI
andemotion
.Possible solutions to this issue could be:
strict-dynamic
inside the CSPAny other ideas are welcome!
In the mean time an interesting blog post that argues
unsafe-inline
for CSS is okay under specific conditionsThe text was updated successfully, but these errors were encountered: