Design
Typography
Porto Faifo Sans and Mono, the type scale and the roles that use it.
Interface and display text use Porto Faifo Sans with
automatic optical sizing, and Inter as the fallback. Code uses
Porto Faifo Mono with the platform monospace as its fallback. The
bundled fonts cover Vietnamese and the ₫ sign, are licensed under SIL OFL 1.1, and are embedded
in faifo-design/styles.css, so a page needs no font route.
A page that serves the fonts as files paints before they arrive. Until then text is drawn by a
platform font fitted to the brand face: Porto Faifo Sans Fallback and
Porto Faifo Mono Fallback sit directly after the brand families in --faifo-font-sans and
--faifo-font-mono, with the brand face's average advance, ascent and descent. Lines keep their
breaks and their baseline when the brand face replaces them, and a host does nothing for it.
#Porto Faifo
The typefaces come from Porto Faifo, an open type collection for digital interfaces with full Vietnamese support. It has three parts made as one system, and the whole collection is published under the SIL Open Font License 1.1 for personal and commercial use.
| Part | What the collection provides | Its role here |
|---|---|---|
| Porto Faifo Sans | One variable font for interfaces and longer reading: weight 300–900, from Light to Black, and optical size 8–72 for small text through display, with tabular and proportional figures | Interface, reading and display text |
| Porto Faifo Mono | A fixed-width companion at 0.576 em a cell, in weights 400 and 500; Vietnamese letters, digits and spaces share one grid | Code and aligned figures |
| Porto Faifo Symbols | 322 interface symbols drawn to match the strokes of the typefaces | Every icon |
The figures are the ones the collection states for its version 1.1.0. Specimens, a symbol search and the downloads are on portofaifo.com; the source and the releases are on GitHub. The package bundles the two typefaces as WOFF2 and records the exact revision in its font provenance.
#Roles, not sizes
An application does not choose a font size. It chooses a component, and the component names the
role of each piece of text. Text applies a role directly when you compose your own markup:
import { Text } from 'faifo-design'
export const Title = () => (
<Text as="h2" variant="headingLg">
Receipts waiting for a bill
</Text>
)The role is independent of the element: as follows the document outline, variant follows
the design. Heading sizes are pinned by level through tokens, so the application passes words.
#Scale
The base interface size is 13 pixels on a 20 pixel line. Numbers in tables are tabular and right-aligned by their column.
| Token | Size | Line |
|---|---|---|
--faifo-text-2xs | 11px | --faifo-line-2xs 12px |
--faifo-text-xs | 12px | --faifo-line-xs 16px |
--faifo-text-sm, --faifo-text-base | 13px | --faifo-line-sm 20px |
--faifo-text-md, --faifo-text-lg | 14px | --faifo-line-md 20px |
--faifo-text-xl | 20px | --faifo-line-xl 24px |
--faifo-text-2xl | 24px | --faifo-line-2xl 32px |
--faifo-text-3xl | 30px | --faifo-line-3xl 40px |
--faifo-text-4xl | 36px | --faifo-line-4xl 48px |
Weights are --faifo-weight-normal (400), -medium (500), -semibold (600) and -bold (700).
The system applies no global negative tracking.
#Machine text
CodeBlock({ value, label, language?, wrap? }) shows literal text a reader copies
or inspects: a JSON payload, a response body, a shell command. It renders
<pre data-ui="code-block"><code> as a labelled, keyboard-focusable region
(role="region", aria-label, tabindex="0"), so a long payload scrolls inside its
own frame and is reachable without a pointer. The block is bounded to 24 lines;
longer text scrolls vertically, and wide lines scroll horizontally unless wrap
(data-wrap="true") folds them, which suits a command but not indented JSON.
language is recorded as data-language for consumers that announce or copy it;
the block does not highlight syntax. Type, frame and focus ring come from tokens
(--faifo-font-mono, --faifo-text-xs, --faifo-panel-border, --faifo-color-surface-subtle).
Specimen: code-block under Status.
#Typography tokens
| Token | Value | Group | |
|---|---|---|---|
--faifo-font-sans | "Porto Faifo Sans", "Porto Faifo Sans Fallback", "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif | Typography | |
--faifo-font-display | var(--faifo-font-sans) | Typography | |
--faifo-font-mono | "Porto Faifo Mono", "Porto Faifo Mono Fallback", "SFMono-Regular", Consolas, "Liberation Mono", monospace | Typography | |
--faifo-text-2xs | 0.6875rem | Typography | |
--faifo-text-xs | 0.75rem | Typography | |
--faifo-text-sm | 0.8125rem | Typography | |
--faifo-text-md | 0.875rem | Typography | |
--faifo-text-base | 0.8125rem | Typography | |
--faifo-text-lg | 0.875rem | Typography | |
--faifo-text-xl | 1.25rem | Typography | |
--faifo-text-2xl | 1.5rem | Typography | |
--faifo-text-3xl | 1.875rem | Typography | |
--faifo-text-4xl | 2.25rem | Typography | |
--faifo-line-2xs | 0.75rem | Typography | |
--faifo-line-xs | 1rem | Typography | |
--faifo-line-sm | 1.25rem | Typography | |
--faifo-line-md | 1.25rem | Typography | |
--faifo-line-lg | 1.25rem | Typography | |
--faifo-line-xl | 1.5rem | Typography | |
--faifo-line-2xl | 2rem | Typography | |
--faifo-line-3xl | 2.5rem | Typography | |
--faifo-line-4xl | 3rem | Typography | |
--faifo-page-title-size | var(--faifo-text-2xl) | Typography | |
--faifo-page-title-line | var(--faifo-leading-tight) | Typography | |
--faifo-leading-tight | 1.2 | Typography | |
--faifo-leading-normal | calc(20 / 13) | Typography | |
--faifo-leading-relaxed | 1.6 | Typography | |
--faifo-weight-normal | 400 | Typography | |
--faifo-weight-medium | 500 | Typography | |
--faifo-weight-semibold | 600 | Typography | |
--faifo-weight-bold | 700 | Typography | |
--faifo-input-font-size | var(--faifo-text-sm) | Typography | |
--faifo-input-line-height | var(--faifo-line-sm) | Typography | |
--faifo-label-font-size | calc(var(--faifo-input-font-size) - 1px) | Typography | |
--faifo-action-font-size | var(--faifo-text-sm) | Typography | |
--faifo-action-line-height | var(--faifo-line-sm) | Typography |