Skip to content

fix: add font-display swap to all @font-face declarations#4415

Open
hs-control-center-bot wants to merge 1 commit intomainfrom
perf/font-display-swap
Open

fix: add font-display swap to all @font-face declarations#4415
hs-control-center-bot wants to merge 1 commit intomainfrom
perf/font-display-swap

Conversation

@hs-control-center-bot
Copy link
Collaborator

@hs-control-center-bot hs-control-center-bot commented Mar 18, 2026

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added font-display: swap; to all 18 @font-face declarations in public/hyperswitch/index.html and all 18 @font-face declarations in public/embeddable-app/index.html.

This prevents FOIT (Flash of Invisible Text) by allowing the browser to render text with a fallback font while InterDisplay loads.

Motivation and Context

Fixes #4414.

Both entry points were missing font-display: swap, which can delay visible text by roughly 300-500ms on slower connections. This change keeps the behavior aligned with the existing Google Fonts display=swap usage and improves perceived load time with low risk.

How did you test it?

Not run locally.

Suggested verification:

  • Verify fonts still load correctly on the dashboard
  • Confirm text is visible immediately on page load without an invisible text flash
  • Run Lighthouse to compare font rendering metrics

Where to test it?

  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

Add font-display: swap to all 18 InterDisplay @font-face declarations
in both hyperswitch and embeddable-app index.html files. This prevents
FOIT (Flash of Invisible Text) by allowing the browser to render text
with a fallback font while the custom font loads, reducing perceived
load time by 300-500ms.

Fixes #4414
@hs-control-center-bot hs-control-center-bot requested a review from a team as a code owner March 18, 2026 13:44
@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 18, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  public/embeddable-app/index.html  0% smaller
  public/hyperswitch/index.html  0% smaller

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves perceived load performance for the dashboard and embeddable app by preventing FOIT for the InterDisplay font family via font-display: swap in inline @font-face declarations.

Changes:

  • Add font-display: swap; to all InterDisplay @font-face blocks in public/hyperswitch/index.html.
  • Add font-display: swap; to all InterDisplay @font-face blocks in public/embeddable-app/index.html.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
public/hyperswitch/index.html Adds font-display: swap to each InterDisplay @font-face to avoid FOIT on hyperswitch dashboard load.
public/embeddable-app/index.html Adds font-display: swap to each InterDisplay @font-face to avoid FOIT in the embedded app.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

Add font-display: swap to @font-face declarations for faster rendering

3 participants