fix(ui): add --apkt-font-family-mono so custom fonts don't break mono text#5682
fix(ui): add --apkt-font-family-mono so custom fonts don't break mono text#5682spennyp wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: f2ab8da The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@spennyp is attempting to deploy a commit to the Reown Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CTA ✍️ ✅ |
f0e47b2 to
fc804ae
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc804ae039
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
I have read the CTA Document and I hereby sign the CTA |
fc804ae to
f2ab8da
Compare
Description
Setting a custom base font via
--apkt-font-family(or the legacy--w3m-font-family) previously broke every monospace piece of UI text (the WalletConnect "Copy link" button, wallet addresses, and amount inputs): they fell back to the browser default font instead of following the custom font.Root cause: the regular font is themeable through the
--apkt-fontFamily-regularCSS variable, whichThemeHelperUtil.generateW3MOverridesoverrides with the custom font. The mono font (--apkt-fontFamily-mono, defaultKHTekaMono) had no equivalent override, so it kept resolving toKHTekaMono, whose@font-faceis dropped once a custom font is set (see #4542). The result was an unloaded family with no fallback.This adds a
--apkt-font-family-monotheme variable that mirrors the regular one and falls back to--apkt-font-familywhen not provided. So a single--apkt-font-familynow also styles monospace text (nothing breaks), while an explicit--apkt-font-family-monois still respected. Default behavior (no custom font) is unchanged.Changes (all in
packages/ui):utils/ThemeHelperUtil.ts: resolvefont-family-monoinnormalizeThemeVariables(falls back to the base font), override--apkt-fontFamily-monoingenerateW3MOverrides, and publish--w3m-font-family-monoingenerateW3MVariablesfor parity.utils/TypeUtil.ts: add--apkt-font-family-monoand--w3m-font-family-monotoThemeVariables.tests/ThemeHelperUtils.test.ts: cover the new override (base font only, explicit mono, mono only, no font).Type of change
Associated Issues
closes #5681
Showcase (Optional)
Reproduction (set a custom
--apkt-font-family, then open the WalletConnect QR view and note "Copy link" does not follow it): https://stackblitz.com/edit/github-e1adycfs?file=src%2FApp.tsxToggling the
--apkt-font-familyline in that StackBlitz shows the before/after. With this branch, the mono text follows the custom font.Checklist