Skip to content

Add brand fonts#7768

Open
kruulik wants to merge 14 commits intomainfrom
fix/missing-fonts
Open

Add brand fonts#7768
kruulik wants to merge 14 commits intomainfrom
fix/missing-fonts

Conversation

@kruulik
Copy link
Contributor

@kruulik kruulik commented Mar 26, 2026

Description Of Changes

Add self-hosted Basier Square, Basier Square Mono, and Eliza font files to align with our brand guidelines.
Inter is retained for Chakra UI theme compatibility.

Code Changes

  • clients/fidesui/src/fonts/fonts.scss - New @font-face declarations for Basier Square (400-700), Basier Square Mono, and Eliza
  • clients/fidesui/src/fonts/*.woff2 - 14 self-hosted font files
  • clients/fidesui/src/ant-theme/global.scss - Import new fonts stylesheet
  • clients/fidesui/src/ant-theme/default-theme.ts - Update fontFamily and fontFamilyCode tokens to use Basier Square

Steps to Confirm

  1. Build admin-ui (cd clients/admin-ui && npm run build) — should succeed without errors
  2. Run the dev server and verify Basier Square renders in the browser for Ant Design components
  3. Verify Inter still renders correctly for Chakra UI components
  4. Check the network tab to confirm .woff2 files load on demand

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

kruulik and others added 11 commits March 25, 2026 19:47
Align antTheme re-export to antd/lib to avoid dual module instances
breaking ConfigProvider context. Add dark() helper to reduce repeated
generate() calls in dark-theme.ts. Add Alert info tokens for both
light and dark themes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Keep Inter loaded for Chakra UI theme compatibility while the new
Basier Square fonts are used by the Ant Design theme.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Mar 27, 2026 0:10am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Mar 27, 2026 0:10am

Request Review

@github-actions
Copy link

github-actions bot commented Mar 26, 2026

Dependency Review

✅ No vulnerabilities found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 263f19e.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@kruulik kruulik marked this pull request as ready for review March 26, 2026 20:28
@kruulik kruulik requested a review from a team as a code owner March 26, 2026 20:28
@kruulik kruulik requested review from speaker-ender and removed request for a team March 26, 2026 20:28
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Clean, focused PR. The font files are well-organized, font-display: swap is used throughout, and the Cypress import is a nice touch to keep component tests consistent with the app. A few things worth addressing:

Suggestions

Fallback font stacks regressed (inline comments on lines 17–18 of default-theme.ts): Both fontFamily and fontFamilyCode swap the previous system-font fallbacks for web fonts (DM Sans, DM Mono, Courier Prime) that aren't self-hosted and aren't system fonts. On any browser, these will silently fail and the stack will fall through to Helvetica/monospace. The old stack had proper cross-platform system fonts (-apple-system, BlinkMacSystemFont, Segoe UI, SFMono-Regular, Consolas, etc.) that covered Mac/Windows/Linux gracefully.

Basier Square Mono has weight/style gaps (inline comment on line 77 of fonts.scss): Weight 400 has no italic, and weight 500 has italic but no normal. May be intentional if those files don't exist from the vendor, but worth confirming.

Eliza is declared but unused (inline comment on line 111 of fonts.scss): The two Eliza @font-face blocks and .woff2 files are included but the font name isn't referenced in default-theme.ts. Browsers won't download the files unless the font-family name appears in a CSS rule, so there's no performance cost — but confirming the intended usage (or pointing to where else it's referenced) would help reviewers understand the intent.

Nice to Have

Adding unicode-range to the @font-face declarations would let browsers skip downloading font files for character ranges not present on the page, which can reduce initial load for apps with narrow character sets. Not a blocker for this PR.

token: {
fontFamily: `Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
fontFamilyCode: `"Basier Square Mono", 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
fontFamily: `"Basier Square", "DM Sans", Helvetica, sans-serif`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"DM Sans" is not a system font and is not self-hosted in this PR, so it will never actually render as a fallback — the browser will skip straight to Helvetica. The previous stack had real system fonts (-apple-system, BlinkMacSystemFont, "Segoe UI", Arial) that would cover Mac, Windows, and Linux. Consider replacing "DM Sans" with system fonts so Windows/Linux users get a decent fallback if Basier Square fails to load:

fontFamily: `"Basier Square", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif`,

fontFamily: `Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
fontFamilyCode: `"Basier Square Mono", 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
fontFamily: `"Basier Square", "DM Sans", Helvetica, sans-serif`,
fontFamilyCode: `"Basier Square Mono", "DM Mono", "Courier Prime", monospace`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here — "DM Mono" and "Courier Prime" are not system fonts and neither is self-hosted, so both will silently fail and the browser jumps to monospace. The previous fallback chain ('SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier) were all real system fonts. Consider:

fontFamilyCode: `"Basier Square Mono", 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,

font-display: swap;
}

@font-face {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Basier Square Mono declarations have some weight/style gaps compared to Basier Square:

  • Weight 400 has no italic variant
  • Weight 500 has italic but no normal variant (basier-square-mono-medium.woff2 is not included)

If these files don't exist from the font vendor, that's fine — browsers will synthesize italic (by slanting) and interpolate missing weights. But if the files do exist and were just overlooked, adding them would prevent browser synthesis artifacts.


// Eliza

@font-face {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Eliza font is declared here but doesn't appear in default-theme.ts (it's not referenced in fontFamily or fontFamilyCode). Is it used somewhere else in the codebase, or is this a placeholder for a future use? If it's not currently used anywhere, the @font-face declarations and .woff2 files add weight to the bundle without benefit (browsers won't download the files unless the font-family name is actually referenced in a CSS rule, so it's fine from a performance standpoint — just worth confirming the intent).

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 26, 2026

Greptile Summary

This PR self-hosts Basier Square, Basier Square Mono, and Eliza fonts inside fidesui and wires them into the Ant Design theme, replacing the previous Inter-based fontFamily token. The 14 woff2 files are declared correctly via @font-face in fonts.scss, and the global Ant Design stylesheet is updated to import them. Inter is preserved for the Chakra UI theme.

Note on PR size: This PR touches 22 files, which exceeds the team's 15-file guideline. 14 of those files are binary font assets with no code complexity, so the spirit of the rule is arguably not violated — but worth flagging for awareness.

Key changes and findings:

  • fonts.scss — 10 Basier Square faces (400–700, normal + italic) and 5 Basier Square Mono faces are declared correctly, but the weight-500 normal face for Basier Square Mono is absent (only the italic variant is declared). The browser will synthesize the weight from the 400 face when non-italic medium-weight mono text is rendered.
  • default-theme.tsfontFamily and fontFamilyCode fallback stacks now list "DM Sans" / "DM Mono" as secondary fonts, neither of which is a system font. If Basier Square files fail to load, users will fall through to Helvetica / monospace with no native OS font in between.
  • global.scss and component.ts — imports look correct and intentional.

Confidence Score: 4/5

Safe to merge; no runtime errors or data-loss risk — only minor font-fallback and missing-face improvements remain.

The changes are straightforward CSS/SCSS font declarations and a small theme-token update. The two P2 comments (missing Mono weight-500 normal face, non-system fallbacks) are cosmetic and won't break functionality, but are worth addressing before the fonts land in a polished state. No logic, API, or data-layer changes are present.

clients/fidesui/src/fonts/fonts.scss (missing Basier Square Mono medium normal face) and clients/fidesui/src/ant-theme/default-theme.ts (fallback font stack).

Important Files Changed

Filename Overview
clients/fidesui/src/fonts/fonts.scss New @font-face declarations for Basier Square (400–700, normal + italic), Basier Square Mono (400/600/700, plus 500 italic only), and Eliza (500 normal + italic). Missing the non-italic weight-500 Mono face.
clients/fidesui/src/ant-theme/default-theme.ts Updated fontFamily and fontFamilyCode tokens to use Basier Square / Basier Square Mono as primary fonts; fallbacks now rely on DM Sans/DM Mono (web fonts, not system fonts) rather than native system-font stacks.
clients/fidesui/src/ant-theme/global.scss Added @use ../fonts/fonts.scss import — correctly wires the new font declarations into the global Ant Design stylesheet.
clients/admin-ui/cypress/support/component.ts Added import of fidesui/src/ant-theme/global.scss so Cypress component tests load the same font declarations as the production bundle.
clients/package-lock.json Trivial change — adds the license: MIT field to the @fontsource/inter lockfile entry; no version or integrity changes.

Reviews (1): Last reviewed commit: "fix bad merge and import correct font" | Re-trigger Greptile

Comment on lines +86 to +95
font-family: "Basier Square Mono";
src: url("./basier-square-mono-semibold.woff2") format("woff2");
font-weight: 600;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Basier Square Mono";
src: url("./basier-square-mono-semibold-italic.woff2") format("woff2");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing Basier Square Mono weight 500 normal face

The Basier Square Mono declarations include font-weight: 500, font-style: italic but there is no corresponding font-weight: 500, font-style: normal face. When code renders non-italic font-weight: 500 monospace text, the browser will synthesize the weight from the nearest declared face (likely 400 normal), which may look noticeably different from a true medium weight.

If the basier-square-mono-medium.woff2 file is available, add a declaration for it:

Suggested change
font-family: "Basier Square Mono";
src: url("./basier-square-mono-semibold.woff2") format("woff2");
font-weight: 600;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Basier Square Mono";
src: url("./basier-square-mono-semibold-italic.woff2") format("woff2");
@font-face {
font-family: "Basier Square Mono";
src: url("./basier-square-mono-regular.woff2") format("woff2");
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Basier Square Mono";
src: url("./basier-square-mono-medium.woff2") format("woff2");
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Basier Square Mono";
src: url("./basier-square-mono-medium-italic.woff2") format("woff2");
font-weight: 500;
font-style: italic;
font-display: swap;
}

If the medium-normal file is intentionally absent (not part of the license), a comment here would help future maintainers understand why the symmetry is broken.

Comment on lines +17 to +18
fontFamily: `"Basier Square", "DM Sans", Helvetica, sans-serif`,
fontFamilyCode: `"Basier Square Mono", "DM Mono", "Courier Prime", monospace`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Non-system fonts used as fallbacks

Both "DM Sans" and "DM Mono" are web fonts, not system fonts. If "Basier Square" / "Basier Square Mono" fail to load (e.g. network error, CORS issue in SSR), the browser falls through to these fonts which are also unlikely to be available on the user's system, then all the way to Helvetica / monospace. The original fontFamily string used -apple-system, BlinkMacSystemFont as the first fallbacks, which provide a native OS font immediately.

Consider interleaving system-font fallbacks before the generic category:

Suggested change
fontFamily: `"Basier Square", "DM Sans", Helvetica, sans-serif`,
fontFamilyCode: `"Basier Square Mono", "DM Mono", "Courier Prime", monospace`,
fontFamily: `"Basier Square", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif`,
fontFamilyCode: `"Basier Square Mono", "DM Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace`,

@kruulik kruulik changed the title Add self-hosted Basier Square and Eliza fonts Add brand fonts Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant