-
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
Remove inline styles to support strict CSP #306
Comments
To clarify, the usual way around this is to use |
We support inline style to meet the following use cases: <FaLayers size="4x" style="background: mistyrose">
<Fa icon={faEnvelope} />
<FaLayersText scale={0.2} translateX={0.4} translateY={-0.4} color="white" style="padding: 0 .2em; background: tomato; border-radius: 1em">
1,419
</FaLayersText>
</FaLayers> |
Hmm, yeah, if values are passed to the component directly, that's unfortunately a little bit complicated - I see only one option that doesn't violate the CSP - add them with a JS function (see https://stackoverflow.com/a/57633533) |
Would you be willing to accept a PR? |
@marekdedic Yes, please feel free to submit a PR! |
@marekdedic Please see #308 (comment) |
Released with v4. Thanks! |
Hi, I would like to use CSP for my site, however, svelte-fa contains inline styles that prevent me from removing
unsafe-inline
from mystyle-src
. Could you please remove inline styles?A quick search through the code reveals several candidates for the offending lines:
svelte-fa/src/fa.svelte
Line 72 in 73233b0
svelte-fa/src/fa-layers.svelte
Line 50 in 73233b0
svelte-fa/src/fa-layers-text.svelte
Line 39 in 73233b0
Thanks!
The text was updated successfully, but these errors were encountered: