Skip to content

Fonts: Hard-code fonts to open-sans and optimize loading - #41

Merged
dabrorius merged 2 commits into
mainfrom
feature/sc-3033-improve-bunny-fonts-loading
Aug 11, 2026
Merged

Fonts: Hard-code fonts to open-sans and optimize loading#41
dabrorius merged 2 commits into
mainfrom
feature/sc-3033-improve-bunny-fonts-loading

Conversation

@dabrorius

@dabrorius dabrorius commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Why

We want to improve performance of fonts loading on booking page. This PR does a few different things:

  1. We remove Liquid settings for fonts. These are not reachable by the user as we do not allow customization of booking page. Instead we hard-code the "Open Sans" font directly.
  2. We drop the | font_link filter and build our own loading links that are non-blocking.
  3. We make sure to load only font weights that we use, and to only use the loaded font weights.

Links

Resolves SC-3033

Media

Screenshot 2026-08-10 at 15 29 20

Comment thread assets/base.css

/* Font weights */
--font-weight-regular: 400;
--font-weight-medium: 500;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Weights 500 and 800 are mentioned, but they were never loaded. We only loaded 400,600,700,400i,600i,700 through the font_link filter.
They would fall back to the closest fall weight silently. Now we explicitly use the font weight that exists.

@dabrorius
dabrorius marked this pull request as ready for review August 10, 2026 14:13
Copilot AI lite review requested due to automatic review settings August 10, 2026 14:13
@dabrorius dabrorius added review Please look at my code shop-team Shop and commerce labels Aug 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 hard-codes the theme’s typography to Open Sans and refactors font loading to be more performant by replacing theme font settings and font_link with explicit, non-blocking Bunny font links.

Changes:

  • Removed font picker settings and hard-coded --font-heading / --font-body to "Open Sans".
  • Replaced font_link usage with manual preconnect, preload (woff2), and non-blocking stylesheet loading.
  • Updated CSS font-weight usage to align with the reduced set of loaded weights (removing medium/extrabold usage).

Reviewed changes

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

Show a summary per file
File Description
snippets/form.liquid Switches form fields to use var(--font-body) instead of theme font settings.
snippets/fonts.liquid Implements manual Bunny font loading with preload + non-blocking stylesheet.
snippets/color-palette-styles.liquid Hard-codes --font-heading and --font-body to Open Sans.
layout/theme.liquid Moves font loading into the head (no longer passes settings into fonts).
layout/session.liquid Moves font loading into the head (no longer passes settings into fonts).
layout/minimal.liquid Moves font loading into the head (no longer passes settings into fonts).
layout/checkout.liquid Moves font loading into the head (no longer passes settings into fonts).
config/settings_schema.json Removes Typography section (font pickers).
config/settings_data.json Removes stored heading_font / body_font settings.
assets/product.css Adjusts product name weight to avoid the removed “medium” variable.
assets/image-banner.css Adjusts banner title weight to avoid the removed “extrabold” variable.
assets/core.min.css Regenerates minified core CSS to reflect updated font-weight variables/usage.
assets/base.css Removes unused font-weight variables (medium, extrabold).
Files not reviewed (1)
  • assets/core.min.css: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread snippets/fonts.liquid
Comment thread snippets/fonts.liquid
@dabrorius
dabrorius requested a review from srgzlb August 11, 2026 08:01
@dabrorius
dabrorius merged commit 93ddf96 into main Aug 11, 2026
1 check passed
@JKinnez JKinnez removed the review Please look at my code label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shop-team Shop and commerce

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants