bestguy / sveltestrap

Bootstrap 4 & 5 components for Svelte
https://sveltestrap.js.org
MIT License
1.3k stars 183 forks source link

Inline styles #464

Open nstuyvesant opened 2 years ago

nstuyvesant commented 2 years ago

In order to get the top security rating, our content security policy (CSP) does not include 'unsafe-inline' for 'style-src'.

The one package we use that has inline styles is sveltestrap (5.9.0). For example, when I use Offcanvas, the rendered HTML includes...

<div aria-hidden class="offcanvas offcanvas-end" style="visibility: hidden;" tabindex="-1">

Would it be possible to associate this styling with class within a style tag? When the site is compiled by SvelteKit, it collects all the CSS into a file and adds a nonce to the tag that loads it.