Skip to content

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

@hs-control-center-bot

Description

@hs-control-center-bot

Description

The 18 @font-face declarations for the InterDisplay font family in both public/hyperswitch/index.html and public/embeddable-app/index.html are missing the font-display: swap descriptor.

Problem

Without font-display: swap, the browser blocks text rendering until the custom font is fully downloaded (FOIT — Flash of Invisible Text). This can add 300–500ms of perceived load time, especially on slower connections.

Solution

Add font-display: swap; to all 18 @font-face declarations in both HTML files. This tells the browser to immediately render text using a fallback font, then swap to the custom font once it's loaded (FOUT — Flash of Unstyled Text), which is a much better UX tradeoff.

Files Affected

  • public/hyperswitch/index.html (18 @font-face declarations)
  • public/embeddable-app/index.html (18 @font-face declarations)

Impact

  • Performance: -300–500ms perceived load time
  • Effort: Minimal — adding one CSS property per declaration
  • Risk: Low — font-display: swap is widely supported and the Google Fonts link already uses &display=swap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions