Skip to content

Fonts

Self-host the fonts used by StrataKit.

StrataKit uses the following fonts:

  • Inter as the primary interface font for most text on the page, including headings.
  • IBM Plex Mono as the monospace font (e.g. for code snippets).

We recommend self-hosting all fonts for better performance, reliability, and security.

StrataKit uses the variable version of Inter, referenced by the font-family name InterVariable in the --stratakit-font-family-sans CSS variable.

To self-host InterVariable, download the InterVariable.woff2 and InterVariable-Italic.woff2 font files from the official website, and serve them alongside your other assets. Then include the following CSS in the <head> of your document, replacing the placeholder paths with the correct path to where the fonts are located:

<style>
@font-face {
font-family: InterVariable;
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url("/path/to/InterVariable.woff2") format("woff2");
}
@font-face {
font-family: InterVariable;
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url("/path/to/InterVariable-Italic.woff2") format("woff2");
}
</style>

StrataKit uses the variable version of IBM Plex Mono, referenced by the font-family name IBM Plex Mono Var in the --stratakit-font-family-mono CSS variable.

To self-host IBM Plex Mono Var, download the IBM Plex Mono Var-Roman.woff2 and IBM Plex Mono Var-Italic.woff2 font files from the official repository, and serve them alongside your other assets. Then include the following CSS in the <head> of your document, replacing the placeholder paths with the correct path to where the fonts are located:

<style>
@font-face {
font-family: "IBM Plex Mono Var";
font-style: normal;
font-weight: 100 700;
font-display: swap;
src: url("/path/to/IBM Plex Mono Var-Roman.woff2") format("woff2");
}
@font-face {
font-family: "IBM Plex Mono Var";
font-style: italic;
font-weight: 100 700;
font-display: swap;
src: url("/path/to/IBM Plex Mono Var-Italic.woff2") format("woff2");
}
</style>

Normally, the browser requests a font file only after it finds text on the page that uses the font. If the text is rendered before the font finishes downloading, this can result in a brief flash of unstyled text (FOUT).

To start the download earlier, add a preload link for InterVariable.woff2 to the <head> of your document. The href value must match the URL in the @font-face rule exactly.

<link rel="preload" href="/path/to/InterVariable.woff2" as="font" type="font/woff2" crossorigin />

The crossorigin attribute is required, even when the font file is served on the same origin.

Vite and other build tools can handle url() references and automatically copy these font files into your output directory with hashed file names. These files can then be safely served with HTTP caching without blocking upgrades to newer versions of the fonts.

The preload link and the @font-face rule must use the same hashed URL. (Vite automatically rewrites preload links in index.html too.)