Packages

@capsizecss/core

4.1.3 · 12 Nov 2025MIT205.9k / weekRepositoryHomepagenpmAtom feed

Your version

8 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.x · latest line
  2. 4.1.3

    12 Nov 2025
    • Bundle Capsize packages with tsdown instead of Crackle. This is an internal change only and does not affect the public API.

  3. 4.1.2

    8 May 2024
    • createFontStack: Prefer postscriptName or fullName for fallback source

      The @font-face declaration aliases generated by createFontStack now favour postscriptName and fullName over familyName from the provided metrics when selecting a local font face as a fallback.

      MDN recommends using either fullName and postscriptName when accessing local fonts to ensure the best matching across platforms, while also enabling selection of a single font face within a larger family, e.g. Arial Bold or Arial-BoldMT within Arial.
      For details see MDN.

      ⚠️ Note: Falling back to familyName (original behaviour) makes this work backwards compatible with older versions of font metrics.

  4. 4.1.1

    5 May 2024
    • createFontStack: Apply line-gap-override with no lineGap in preferred font

      Ensure that the line-gap-override property is applied correctly when overriding a fallback font with a web font that has no lineGap.
      Previously if the override was zero it would be omitted from the declaration, rather than the correct behaviour of overriding the fallback metric to zero.

    • createFontStack: Ensure provided `size-adjust` is factored into metric overrides

      Ensures a custom size-adjust value provided via the fontFaceProperties option is factored into the calculations for the metric overrides.

  5. 4.1.0

    8 Mar 2024
    • xWidthAvg: Add subset support for non-latin character sets

      Previously the xWidthAvg metric was calculated based on the character frequency as measured from English text only.
      This resulted in the xWidthAvg metric being incorrect for languages that use a different unicode subset range, e.g. Thai.

      Supporting Thai now enables adding support for other unicode ranges in the future.

  6. 4.0.0

    16 Feb 2024
    • Breaking

      Precompile Capsize packages with [Crackle]

      Migrating Capsize packages to be precompiled with [Crackle], with a key change being Crackle now handles entry points instead of [Preconstruct].

      Other benefits include:

    • createFontStack: Append original fallback font name to the font stack

      The fontFamily returned from createFontStack now includes the original fallback font name(s). These are appended to the end of the font stack in the case the preferred font and generated fallbacks are not available.

      import lobster from '@capsizecss/metrics/lobster';
      import arial from '@capsizecss/metrics/arial';
      
      const { fontFamily } = createFontStack([lobster, arial]);

      Where fontFamily is now:

      - `Lobster, 'Lobster Fallback: Arial'`
      + `Lobster, 'Lobster Fallback: Arial', Arial`
    • createFontStack: Quote font-family in @font-face declaration if needed

      Previously, when using fontFaceFormat: 'styleObject', the generated fallback name was not quoted as necessary within the @font-face declaration.
      This could cause issues if the font family name contained spaces or other characters that required quoting.

  7. 3.x
  8. 3.1.1

    7 Jun 2023
    • createFontStack: Apply metric overrides conditionally

      Addresses an issue where metric overrides would be applied for fonts with the same metric values.
      The ascent-override, descent-override and line-gap-override properties are now all conditional, only returned when the metrics differ between the preferred font and its fallback(s).

  9. 3.1.0

    31 Jan 2023
    • Add createFontStack for metrics-based font family fallbacks.

      Creates metrics-based @font-face declarations to improve the alignment of font family fallbacks, which can dramatically improve the Cumulative Layout Shift metric for sites that depend on a web font.

    • Add additional properties to FontMetrics type definition.

      Previously the FontMetrics type captured only the metrics required by the options for the createStyleObject and createStyleString APIs.
      With additional APIs coming that require a different subset of metrics, the type now reflects the structure of the data from the metrics package.

      The additional properties are: familyName, category, xHeight and xWidthAvg.
      See documentation for more details.

  10. 3.0.0

    23 Aug 2021
    • Breaking

      The capsize package has been moved to its own organisation on npm called @capsizecss. This will allow an official ecosystem of tooling to be added over time.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.