Skip to content

Add custom heading and body font settings - #3975

Open
HarshankPatel9038 wants to merge 1 commit into
Shopify:mainfrom
HarshankPatel9038:feature/custom-font-support
Open

Add custom heading and body font settings#3975
HarshankPatel9038 wants to merge 1 commit into
Shopify:mainfrom
HarshankPatel9038:feature/custom-font-support

Conversation

@HarshankPatel9038

@HarshankPatel9038 HarshankPatel9038 commented Sep 6, 2026

Copy link
Copy Markdown

PR Summary

Adds optional custom heading and body font settings. Merchants can use either a Google Fonts stylesheet URL or a direct WOFF2 font URL without editing theme code.

Why are these changes introduced?

Dawn currently supports Shopify's font picker for typography. This change gives merchants an opt-in way to use custom brand fonts while preserving the existing font picker as the default experience.

What approach did you take?

  • Added separate opt-in settings for custom heading and body fonts.
  • Added fields for font family, font URL, weight, and style.
  • Created a reusable custom-fonts snippet that:
    • Loads Google Fonts stylesheet URLs.
    • Defines @font-face for direct WOFF2 URLs.
    • Uses font-display: swap.
  • Updated both theme.liquid and password.liquid so custom fonts apply consistently across the storefront and password page.
  • Preserved the existing Dawn font-picker behavior whenever custom fonts are disabled.
  • Added schema translations for all supported Dawn schema locales.

Other considerations

  • This is fully opt-in and does not change the appearance of existing themes after upgrade.
  • A Google Fonts URL requires the configured font-family value to match the family provided by the stylesheet.
  • Direct font URLs are expected to point to WOFF2 files.

Decision log

# Decision Alternatives Rationale Downsides
1 Keep Shopify font picker as the default Replace the existing font picker Prevents visual changes for existing merchants Adds additional typography settings
2 Support Google Fonts stylesheet and direct WOFF2 URLs Support only one source type Supports common merchant font workflows Merchants must provide a valid URL
3 Use font-display: swap Default font-loading behavior Avoids invisible text while custom fonts load A brief fallback-font render can occur

Visual impact on existing themes

None by default. Existing themes retain their current selected heading and body fonts. Custom fonts are applied only after a merchant enables the relevant setting.

Testing steps/scenarios

  • Ran shopify theme check --path .
  • Validated updated Liquid, schema, locale, and snippet files.
  • Enable a custom heading Google Fonts stylesheet and verify headings use the configured font.
  • Enable a custom body Google Fonts stylesheet and verify body text uses the configured font.
  • Configure direct WOFF2 URLs for heading and body fonts and verify each loads correctly.
  • Disable custom fonts and verify the existing Dawn font-picker selection is restored.
  • Verify the password page uses the same custom font settings.
  • Test on mobile and supported desktop browsers.
  • Test accessibility and fallback rendering with a failed font URL.

Checklist

  • Added PR summary for release notes
  • Requested review from UX
  • Created a ticket for the help.shopify.com documentation team about updates to theme settings. (Internal-only task)
  • Followed theme code principles
  • Linted with Theme Check
  • Tested on mobile
  • Tested on multiple browsers
  • Tested for accessibility

- Introduced new settings for custom heading and body fonts in settings_schema.json, allowing users to specify font family, URL, weight, and style.
- Updated password.liquid and theme.liquid to conditionally load custom fonts based on user settings.
- Created a new snippet, custom-fonts.liquid, to handle the loading of fonts from Google Fonts or direct WOFF2 URLs.
- Added localization for new font settings in multiple languages.
- Updated release notes to reflect the addition of custom font support.
@HarshankPatel9038

Copy link
Copy Markdown
Author

I have signed the CLA!

@HarshankPatel9038 HarshankPatel9038 changed the title feat: Add support for custom heading and body fonts Add custom heading and body font settings Sep 6, 2026
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.

1 participant