fix: load Google Fonts correctly with strict CSP #77

Merged
naomi merged 1 commits from chore/font into main 2026-03-05 10:32:20 -08:00
Owner

Summary

  • Allows fonts.googleapis.com in style-src and fonts.gstatic.com in font-src so the browser can load Google Fonts
  • Adds preconnect hints and the Google Fonts import (Griffy, Kalam, Creepster, Henny Penny) to index.html
  • Sets the body font to Kalam and heading font to Griffy, with utility classes for Creepster and Henny Penny
  • Disables Angular's inlineCritical optimisation, which was causing the stylesheet to be deferred via onload="this.media='all'" — an inline event handler blocked by the strict script-src CSP, preventing the heading font rules from ever applying to screen media

Test plan

  • Rebuild and reload the app
  • Verify headings render in Griffy
  • Verify body text renders in Kalam
  • Check DevTools Styles tab confirms the h1-h6 font-family rule is matched

This PR was created with help from Hikari~ 🌸

## Summary - Allows `fonts.googleapis.com` in `style-src` and `fonts.gstatic.com` in `font-src` so the browser can load Google Fonts - Adds preconnect hints and the Google Fonts import (Griffy, Kalam, Creepster, Henny Penny) to `index.html` - Sets the body font to Kalam and heading font to Griffy, with utility classes for Creepster and Henny Penny - Disables Angular's `inlineCritical` optimisation, which was causing the stylesheet to be deferred via `onload="this.media='all'"` — an inline event handler blocked by the strict `script-src` CSP, preventing the heading font rules from ever applying to screen media ## Test plan - [ ] Rebuild and reload the app - [ ] Verify headings render in Griffy - [ ] Verify body text renders in Kalam - [ ] Check DevTools Styles tab confirms the `h1-h6` font-family rule is matched ✨ This PR was created with help from Hikari~ 🌸
hikari added 1 commit 2026-03-05 10:29:04 -08:00
fix: load Google Fonts correctly with strict CSP
Node.js CI / CI (pull_request) Successful in 1m37s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m41s
3b3ac3d1ef
- Allow fonts.googleapis.com in style-src and fonts.gstatic.com in font-src
- Add Google Fonts preconnect links and import (Griffy, Kalam, Creepster, Henny Penny)
- Set body font to Kalam and heading font to Griffy
- Disable Angular inlineCritical optimisation to prevent deferred CSS loading via onload attribute, which was blocked by the strict script-src CSP
naomi merged commit 7d8c6bf21c into main 2026-03-05 10:32:20 -08:00
naomi deleted branch chore/font 2026-03-05 10:32:20 -08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/library#77