@zalify/storefront-kit 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,5 +29,10 @@ export function parseFontHandle(handle) {
29
29
  }
30
30
  export function googleFontsHref(family, axes = 'ital,wght@0,400;0,500;0,700;1,400') {
31
31
  const param = family.trim().replace(/ /g, '+');
32
- return `https://fonts.googleapis.com/css2?family=${param}:${axes}&display=swap`;
32
+ // display=optional: the font never swaps in after first paint, so a
33
+ // late-arriving font file can't reflow text (zero font CLS). With the
34
+ // stylesheet loaded async (CssVariables), swap would otherwise shift
35
+ // layout on every cold load; optional shows the fallback first visit
36
+ // and the brand font from the cache on later views.
37
+ return `https://fonts.googleapis.com/css2?family=${param}:${axes}&display=optional`;
33
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zalify/storefront-kit",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "The Zalify storefront SDK: framework-agnostic commerce logic (/commerce), the theme contract types and validators (/schemas), the canvas-editor bridge (/editor), and the React theme engine + shared components (/ui, /react/server). Consumed as TypeScript source inside the zalify-storefronts monorepo; published as compiled ESM + d.ts.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -38,5 +38,10 @@ export function googleFontsHref(
38
38
  axes = 'ital,wght@0,400;0,500;0,700;1,400',
39
39
  ): string {
40
40
  const param = family.trim().replace(/ /g, '+');
41
- return `https://fonts.googleapis.com/css2?family=${param}:${axes}&display=swap`;
41
+ // display=optional: the font never swaps in after first paint, so a
42
+ // late-arriving font file can't reflow text (zero font CLS). With the
43
+ // stylesheet loaded async (CssVariables), swap would otherwise shift
44
+ // layout on every cold load; optional shows the fallback first visit
45
+ // and the brand font from the cache on later views.
46
+ return `https://fonts.googleapis.com/css2?family=${param}:${axes}&display=optional`;
42
47
  }