-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
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:
- Appear in the Font Family dropdown alongside uploaded and system fonts
- Be previewed in the builder canvas (via a generated @font-face rule)
- Be included in the published site's CSS output
Proposed implementation
- Add an externalFonts field to ProjectMeta in packages/sdk/src/schema/pages.ts:
{ family: string, url: string, weight?: number, style?: "normal" | "italic" }[] - Extend addFontRules() in packages/sdk/src/css.ts to also process externalFonts
- Pass externalFonts to addFontRules in the canvas (apps/builder/app/canvas/shared/styles.ts)
- Include external fonts in toItems() (fonts-manager/item-utils.ts) so they appear in the dropdown
- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels