ref(frontend): Replace Bootstrap with Tailwind CSS

Swap the Bootstrap CDN for a self-hosted Tailwind CSS build, mirroring
the myice setup: standalone Tailwind CLI v3.4.17, a one-off build-css.sh
script, and a gitignored generated style.css.

- Add tailwind.config.js, style-input.css, build-css.sh at repo root
- Rewrite templates/index.html: drop Bootstrap link/script, link
  /style.css, convert all classes to Tailwind utilities; showAlert now
  uses a class lookup so the JIT scanner detects dynamic classes
- Add /style.css FileResponse route in main.py; drop cdn.jsdelivr.net
  from script-src/style-src in the CSP
- Flip test assertion to assert cdn.jsdelivr.net is absent from CSP

The generated style.css and tailwindcss binary are gitignored; run
./build-css.sh to regenerate (or --watch for dev).
This commit is contained in:
2026-07-08 14:10:37 +02:00
parent 1a807cfeb4
commit 9c7f2bde11
7 changed files with 100 additions and 34 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ def test_root_serves_csp_with_nonce():
csp = response.headers.get("content-security-policy", "")
assert "nonce-" in csp
assert "script-src" in csp
assert "cdn.jsdelivr.net" in csp
assert "cdn.jsdelivr.net" not in csp
assert "connect-src" in csp
assert "login.infomaniak.com" in csp
assert "api.coingecko.com" in csp