@zalify/storefront-kit 0.1.3 → 0.1.5

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,10 +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
- // 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`;
32
+ // display=swap so the brand font always applies once it arrives, even
33
+ // after first paint (optional was tried and skipped cold loads
34
+ // entirely). The swap reflow is a small CLS cost; the catastrophic
35
+ // shifts once blamed on it were actually the hydration mismatch fixed
36
+ // in CssVariables' loader.
37
+ return `https://fonts.googleapis.com/css2?family=${param}:${axes}&display=swap`;
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zalify/storefront-kit",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
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,10 +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
- // 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`;
41
+ // display=swap so the brand font always applies once it arrives, even
42
+ // after first paint (optional was tried and skipped cold loads
43
+ // entirely). The swap reflow is a small CLS cost; the catastrophic
44
+ // shifts once blamed on it were actually the hydration mismatch fixed
45
+ // in CssVariables' loader.
46
+ return `https://fonts.googleapis.com/css2?family=${param}:${axes}&display=swap`;
47
47
  }