Conversation
…provided - Skip Google Fonts import in packages/ui when --w3m-font-family is set - Skip KHTeka font-face declarations in packages/ui-new when --w3m-font-family is set - Improves performance by avoiding unnecessary font downloads when custom fonts are used - Maintains backward compatibility - default behavior unchanged when no custom font provided Fixes #4475 Co-Authored-By: TomTom <tomtom@reown.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
10 Skipped Deployments
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
|
Can you add some tests for this change? |
- Add tests for packages/ui ThemeUtil to verify Google Fonts import behavior - Add tests for packages/ui-new ThemeUtil to verify KHTeka font-face behavior - Tests verify fonts are imported when no custom font family is provided - Tests verify fonts are NOT imported when custom font family is provided - Tests ensure keyframe animations are always included regardless of font settings Co-Authored-By: TomTom <tomtom@reown.com>
- Export createRootStyles in packages/ui/src/utils/ThemeUtil.ts - Export createRootStyles in packages/ui-new/src/utils/ThemeUtil.ts - Enables direct testing of conditional font import logic Co-Authored-By: TomTom <tomtom@reown.com>
- Apply prettier formatting to ThemeUtil.test.ts files - Fix quote consistency and line spacing - Resolve code_style (prettier) CI check failure Co-Authored-By: TomTom <tomtom@reown.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
pay-test-exchange | 961037b | Jul 24 2025, 07:34 AM |
1 similar comment
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
pay-test-exchange | 961037b | Jul 24 2025, 07:34 AM |
Remove unnecessary third-party font imports when custom fonts are provided
Summary
This PR fixes issue #4475 by conditionally importing external fonts only when no custom font family is provided via the
--w3m-font-familyCSS variable. This optimization improves performance by avoiding unnecessary font downloads when developers provide their own custom fonts.Changes Made
packages/ui/src/utils/ThemeUtil.ts
Interfont when--w3m-font-familyis not setpackages/ui-new/src/utils/ThemeUtil.ts
--w3m-font-familyis not setTechnical Implementation
themeVariables?.['--w3m-font-family'] ? css`` : css...``themeVariablesparameter increateRootStylesfunctioncsstemplate literals for type-safe CSS generationTesting
pnpm buildpasses successfullypnpm run prettier:formatpasses successfullyPerformance Impact
Backward Compatibility
--w3m-font-familyis not providedLink to Devin run: https://app.devin.ai/sessions/d0165cd1abce471badaf6c04fe7bafd7
Requested by: TomTom (tomas.rawski@reown.com)
Fixes #4475