Dough Git

commit

Allow iconsax's icon colour style in the CSP

commit
21a4a7750f7f4612c2c94823c20375ae18ac1881
author
Clove Twilight <[email protected]>
date
2026-10-29 10:02
iconsax sets style="color:currentColor" on every icon, which style-src 'self' blocked, logging a CSP error per icon. Allowed by exact hash only. Same for SvelteKit's visually-hidden route announcer, which otherwise could show on screen after navigation.

diff --git a/vite.config.ts b/vite.config.ts
index ca54f2d..17cbd10 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -22,7 +22,14 @@ export default defineConfig({
         directives: {
           "default-src": ["none"],
           "script-src": ["self"],
-          "style-src": ["self"],
+          // Two exact style attributes only: iconsax's color:currentColor on every icon,
+          // and SvelteKit's visually-hidden route announcer
+          "style-src": [
+            "self",
+            "unsafe-hashes",
+            "sha256-muhGX4Mn7np2XQi6DH6Iz+0SHdws6/BLgVigE46O3Xc=",
+            "sha256-S8qMpvofolR8Mpjy4kQvEm7m1q8clzU4dfDH0AmvZjo=",
+          ],
           "img-src": ["self", "https:", "data:"],
           "font-src": ["self", "https://raw.doughmination.gay"],
           "connect-src": ["self"],