Using Allo as an Inter replacement

Published

Allo is a nice Open Source font for interfaces designed by Josh Puckett. It's similar to Inter, but with a few extra stylistic sets and axes. I particularly like the disambiguation (ss02) set as well as the fractions (frac) set for displaying amounts in my recipes.

Since I was already using Inter for certain elements on this website, it was pretty easy to make the swap and benefit from Allo's extra customization options. Installing the font was done with pnpm add allo-font, and then I added it to my SvelteKit layout with import "allo-font";. Then I made the following change to my layout.css to configure the font defaults, and add some utility classes to make styling individual elements a bit easier.

@theme {
  --font-sans: Allo, sans-serif;
}

/* Allo OpenType features */
@layer base {
  body {
    /* Allo stylistic sets */
    font-feature-settings:
      "ss02" 1,
      "ss03" 1,
      "frac" 1;
  }
}

/* Variable font axes */
@utility allo {
  --allo-weight: 400;
  --allo-roundness: 50;

  font-variation-settings:
    "wght" var(--allo-weight),
    "ROND" var(--allo-roundness);
}

/* Individual axis controls */
@utility allo-weight-* {
  --allo-weight: --value(integer);
}

@utility allo-roundness-* {
  --allo-roundness: --value(integer);
}