fix: declare italic ClarityCity faces and test the custom.css<->static/fonts contract - #396
Merged
Merged
Conversation
…c/fonts contract Adds 9 @font-face blocks with font-style: italic for the ClarityCity 100-900 weights, pointing at the *Italic.woff2/woff/ttf files that were already committed under static/fonts/ but never referenced. Without these, browsers rendered every <em>/*italic* as a synthetic oblique instead of the real italic face, and 764K of font files shipped on every deploy as unreachable bytes. Adds tests/css-assets.test.mjs, which reads every url() reference in src/css/custom.css and asserts: - the extraction finds a non-zero number of references, so a regression in the regex cannot make the other assertions vacuous - each reference resolves to a real file under static/, compared case-sensitively per path segment via readdirSync (a case-only typo resolves on a case-insensitive developer filesystem and 404s on GitHub Pages) - every file under static/fonts/ is referenced by at least one @font-face, so an orphaned or unreferenced font file fails the build instead of shipping silently Closes #317 Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
castrojo
reviewed
Sep 21, 2026
castrojo
left a comment
Member
There was a problem hiding this comment.
Reviewed: diff cleanly declares 9 italic ClarityCity faces (weights 100-900) in src/css/custom.css matching existing font files under static/fonts/, and adds unit tests in tests/css-assets.test.mjs that verify URL resolution.
Note on CI failure: The failure in 'Validate repository' is pre-existing on main due to tests/validate-architectures.test.mjs missing sourceUrl in its validRecord fixture after commit dc5fe09, unrelated to this PR's CSS/font changes.
Awaiting second/maintainer review and CI fix on main.
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.
Summary
Closes #317.
Two changes, matching the issue's recommendation:
src/css/custom.css— adds 9@font-faceblocks withfont-style: italicfor the ClarityCity 100-900 weights, pointing atthe
*Italic.woff2/woff/ttffiles that were already committed understatic/fonts/but never referenced by any@font-face. Withoutthis, every
<em>/*italic*on the site rendered as a browsersynthetic oblique instead of the real italic face, and 764K of font
files shipped on every deploy as unreachable bytes. This is option
(a) from the issue — restoring the intended typography at no
download cost for readers who never hit italic text — over deleting
the files, since they were clearly committed deliberately alongside
their upright counterparts.
tests/css-assets.test.mjs— a new test-only file that readsevery
url()reference insrc/css/custom.cssand asserts:guard: a regression in the regex cannot silently make the other
assertions pass trivially)
static/, comparedcase-sensitively per path segment via
readdirSync(a case-onlytypo resolves on a case-insensitive developer filesystem and 404s on
GitHub Pages)
static/fonts/is referenced by at least one@font-faceincustom.css, so an orphaned font file fails thebuild instead of shipping silently
This lands as one PR rather than split in two, per the issue's own
note: the orphan-detection test is red against
mainuntil the italic@font-faceblocks exist, so the CSS change and the test that pins ithave to move together.
Verification
npm run test:unit— 348 tests, 344 pass. The 2 failures are intests/validate-architectures.test.mjsand are pre-existing onmainat this branch's base commit (reproduced in isolation withnode --test tests/validate-architectures.test.mjsbefore this PR'schanges were applied); unrelated to
custom.css/static/fonts/.npx prettier --check tests/css-assets.test.mjs src/css/custom.css— clean.npm run build— succeeds;build/fonts/contains all 54 files, andthe only warnings emitted are pre-existing HTML-minifier diagnostics
on
/,/architectures/,/resources/unrelated to fonts or CSS.Checklist
git commit -s)— hive: backend=copilot model=claude-sonnet-5
🐝 Hive Agent:
contributor| SHA:f4335e8