Dough Git

commit

Allow iconsax's icon colour style in the CSP

commit
8621e9f99dd1f78cfc4de4651c6b7f70029f6563
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 b877527..3feda8f 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -23,7 +23,14 @@ export default defineConfig({
         directives: {
           "default-src": ["self"],
           "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", "data:", "https:"],
           "font-src": ["self", "https://raw.doughmination.gay"],
           "connect-src": ["self"],