Skip to content

feat: Support external font URLs in Fonts Manager (preview + dropdown) #5642

@vianmora

Description

@vianmora

Problem

When using custom fonts (e.g. self-hosted on a CDN, or loaded via a @font-face in Custom Code), there is currently no way
to:

  • See the font previewed in the builder canvas
  • Have the font appear in the Font Family dropdown

The only workaround is to upload the font files as assets, which counts against the 50-asset-per-project limit. For font
families with many weights/styles (e.g. a variable font with 50+ files), this limit is immediately exhausted by a single
typeface.

Expected behavior

Users should be able to declare an external font (family name + URL) directly in the Fonts Manager, without uploading the
actual files. The declared font should:

  1. Appear in the Font Family dropdown alongside uploaded and system fonts
  2. Be previewed in the builder canvas (via a generated @font-face rule)
  3. Be included in the published site's CSS output

Proposed implementation

  1. Add an externalFonts field to ProjectMeta in packages/sdk/src/schema/pages.ts:
    { family: string, url: string, weight?: number, style?: "normal" | "italic" }[]
  2. Extend addFontRules() in packages/sdk/src/css.ts to also process externalFonts
  3. Pass externalFonts to addFontRules in the canvas (apps/builder/app/canvas/shared/styles.ts)
  4. Include external fonts in toItems() (fonts-manager/item-utils.ts) so they appear in the dropdown
  5. Add a small "Add external font" UI in the Fonts Manager panel

No database migration needed — externalFonts would be a new optional JSON field in the existing projectMeta blob.

Alternatives considered

  • Using Custom Code (head) to inject a or @font-face — works on the published site but the font is invisible in the
    builder canvas and not selectable in the dropdown
  • Uploading all font files — hits the asset limit quickly for large font families

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