fix(css): restore sans-serif UI font - #88
Merged
Merged
Conversation
`* { font-family: "Lato" }` had no fallback, and the Lato it depended on
came from a Google Fonts @import that host apps block under their CSP. So
Lato never loaded and every element the rule matched fell back to the
browser default — a serif face — while MUI components kept their own sans
stack and looked correct.
Visible as serif flexlayout tab labels, "No Results Yet!" in the results
panel, and the Heap/FPS readout over the canvas. Confirmed in the browser:
no Google Fonts stylesheet was present, and text set in Lato measured
identically to text set in a deliberately nonexistent family.
Replaces it with a --cram-font-family variable holding the same stack the
MUI theme uses, so unstyled elements agree with Typography, and drops the
now-unused external font request. workbenchTheme.css feeds the same
variable into flexlayout's --font-family, keeping a literal fallback in
case those styles are ever consumed without styles.css.
Co-Authored-By: Claude Opus 5 <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.
Several parts of the UI render in a serif face: flexlayout tab labels, "No Results Yet!" in the results panel, and the Heap/FPS readout over the canvas.
Cause
src/css/styles.csscarried a universal rule with no fallback, depending on a webfont pulled from Google Fonts:Host apps block that request under their CSP, so Lato never loaded — and with no fallback in the declaration, every element the rule matched dropped to the browser's default serif. MUI components were unaffected because their emotion classes outrank
*and carry the theme's own sans stack, which is why the app looked half-right rather than obviously broken.Evidence
Measured in the running app rather than inferred:
document.styleSheetscontained zero Google Fonts entries — the@importnever landed.Latomeasured 327.02px; the same text in a deliberately nonexistent family__NoSuchFont__measured 327.02px. Identical, soLatowas resolving to nothing. Arial measured 366.38px for comparison.Fix
Introduces
--cram-font-familyholding the same stack the MUI theme uses, applies it to*and.App, and drops the now-unused external font request.Using the MUI stack rather than a bare
Arialmeans unstyled elements resolve to the same fontTypographyalready uses, instead of introducing a second sans face. Arial remains in the stack as the conventional fallback.workbenchTheme.cssfeeds the same variable into flexlayout's--font-family, keeping a literal fallback in case those styles are ever consumed withoutstyles.css.Verification
Confirmed in the browser against project-varese — flexlayout root, tab buttons, "No Results Yet!" and the Heap/FPS label all now compute to the sans stack, and render accordingly.
Also swept for other fallback-less
font-familydeclarations in CSS and inlinefontFamilyin components: there are none, so these were the only affected paths.2226 tests / 104 files pass, lint and typecheck clean. CSS-only change; no behavioural surface.
Split out of #87, which is unrelated feature work. No file overlap between the two.
🤖 Generated with Claude Code