-
fix(ssg): fix white header on dark theme and resolve critters CSP block (#66)
released this
2026-10-24 20:48:59 +03:00 Summary
- Critters preload: Set
preload: falseinssgPluginto eliminate
onload="this.media='all'"event handlers on external stylesheets,
which violated Content Security Policy (script-src 'self'/
require-trusted-types-for 'script') and left the compiled stylesheet
permanently blocked inmedia="print". - Dark theme selector retention: Added
allowRules: [/\.dark/]to
Critters options so dark theme selectors and palette variables are
preserved during critical CSS inlining. - Immediate theme variables: Initialized
--rb-background,
--rb-base, and--rb-textinTHEME_INIT_STYLESfor:rootand
.darkalongside background color to ensure components likePageHead
instantly reflect the active theme.
Verification
pnpm typecheck: Passed (0 errors)pnpm lint: Passed (0 warnings)pnpm test: Passed (all suites passed)pnpm build: Passed (clean SSG generation)- Local Playwright browser test with dark color scheme verified
headerBgisrgb(20, 20, 20)and zero CSP inline handler violations.
Downloads
- Critters preload: Set