-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing inline styles #308
Conversation
Thanks! |
Hi, sorry to bother, but could you please release this change? Thanks! |
@marekdedic I apologize for taking so long to reply to you. I noticed that making this change would cause the package to lose one of its features, "No CSS file required." Can we use a solution similar to ".style.background = 'red';" to solve the CSP issue? |
Hi, |
The solution similar to https://stackoverflow.com/a/57633533. Which you mentioned in this comment, does not require extracting the CSS. |
The current solution also doesn't require extracting the CSS - it's up to the user. If they want to keep the CSS as part of the JS, they can (they won't be able to have strict CSP, but that's kind of the point of strict CSP...). |
Sure, I think we can release this together with this PR. It will be a BREAKING CHANGE. |
Released with v4. Thanks! |
I've made it so no inline styles will be produced, unless you add a
<Fa style="...">
property - then you can't really be helped :DAdditionally, I've made it so the docs extract their CSS into a separate file, I mainly did it because I used the docs to test the thing (and you need CSS in
<head>
or a separate file to not trigger CSP), but it should improve performance, so I left it in the PR...