Skip to content
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

A version without inline css #812

Open
czirkoszoltan opened this issue Mar 15, 2018 · 2 comments
Open

A version without inline css #812

czirkoszoltan opened this issue Mar 15, 2018 · 2 comments

Comments

@czirkoszoltan
Copy link

Currently the prebuilt version of SweetAlert (from the CDN) also contains the CSS, and injects a style tag in the DOM. It is nice that the library is self-contained, but this prevents using it with a content security policy where 'unsafe-inline' is not enabled for script-src.
Also it would be nice to have such a version because it would allow theming the alert more easily; by modifying the CSS rules instead of working around the default ones.
#748 is somewhat related.

@t4t5
Copy link
Owner

t4t5 commented Mar 26, 2018

Very good point about the content security policy, which is something that I overlooked.

Maybe we can export the library into two different files – sweetalert.js and sweetalert-unstyled.js? I still like the idea of having the ability to only import a single file to get started, but there should obviously also be an option to manage the styling yourself.

@mateo9
Copy link

mateo9 commented Sep 25, 2020

@t4t5 Is there any version of SweetAlert from CDN without inline css? I have requirement to remove 'unsafe-inline' from style_src and sweetalert stop working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants