Tighten CSP: remove inline styles + unused icon font (style-src & font-src → 'self')#17
Merged
Merged
Conversation
Moves the 6 inline style="..." attributes into CSS classes so the CSP can
drop 'unsafe-inline' from style-src:
- 5 per-project background tints on .projekt-block cards (projekte.html) ->
.projekt-block--{impfen,labhive,coronika,dw,did} in custom.css
- text-align:end on the letter date (offenerbrief) -> .text-end
Colours/alignment unchanged.
CSP style-src is now `'self'` (was `'self' 'unsafe-inline'`). Verified: the
built _site has zero inline style attributes, on*= handlers, <style> blocks or
javascript: URIs, so nothing else needs the inline allowance. The new classes
survive PurgeCSS (they are referenced in the HTML). Build, html-proofer, and
prettier all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…self' The webflow-icons @font-face embedded a ~2.6 KB base64 TTF as a data: URI, which was the only reason font-src needed `data:`. That icon font is unused: no `w-icon-` class exists in any page (verified in source and built _site), and PurgeCSS already strips it from production CSS. Removed the @font-face block from webflow.css (the inert `.w-icon-*` rules are left as-is — they match nothing and are purged in prod) and dropped `data:` from font-src. All remaining fonts are the same-origin Inter webfont under /assets/fonts/, so font-src is now `'self'`. Verified: webflow.css still balanced/valid, Inter fonts intact, build + purge-css + html-proofer + prettier pass, no data: font remains in _site, and the project-card colours are unchanged in the purged production CSS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…elf' Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tightens the Content-Security-Policy by removing the two things that forced loose directives, at the same time cleaning up the HTML/CSS.
style-src 'self' 'unsafe-inline'→style-src 'self'Moved all 6 inline
style=attributes into CSS classes:.projekt-blockcards (projekte.html) →.projekt-block--{impfen,labhive,coronika,dw,did}incustom.csstext-align: endon the letter date (offenerbrief-epa-2025.html) →.text-endColours/alignment are unchanged (verified byte-for-byte in the purged production CSS). Confirmed the built
_sitehas zero inlinestyle=attributes,<style>blocks,on*=handlers, orjavascript:URIs — so nothing else needed the inline allowance.font-src 'self' data:→font-src 'self'The only thing requiring
data:was an embeddedwebflow-icons@font-face(~2.6 KB base64 TTF data URI). That icon font is unused — now-icon-class exists anywhere in source or the built site, and PurgeCSS already strips it from production. Removed the@font-facefromwebflow.css(the inert.w-icon-*rules are left as-is; they match nothing). All remaining fonts are the same-origin Inter webfont under/assets/fonts/.Resulting CSP
(
img-srckeepsdata:— data-URI images still exist in the CSS.)Verification
webflow.cssbraces balanced (valid), Inter fonts intact, nodata:font in_site, project-card colours unchanged in purged CSS;jekyll build,purge-css,html-proofer, andprettier --checkall pass. Updatedmemory/csp-policy.mdto match.Noted, not done (out of scope)
The 5 project logos in
projekte.htmlhave emptyalt=""— an a11y gap (likely among the pa11y findings). Happy to fix in a follow-up.🤖 Generated with Claude Code