Open czirkoszoltan opened 6 years ago
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.
@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.
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.