Search the documentation

Type to search page titles, component names and descriptions.

    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.

    PartWhat the collection providesIts role here
    Porto Faifo SansOne 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 figuresInterface, reading and display text
    Porto Faifo MonoA fixed-width companion at 0.576 em a cell, in weights 400 and 500; Vietnamese letters, digits and spaces share one gridCode and aligned figures
    Porto Faifo Symbols322 interface symbols drawn to match the strokes of the typefacesEvery 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.

    TokenSizeLine
    --faifo-text-2xs11px--faifo-line-2xs 12px
    --faifo-text-xs12px--faifo-line-xs 16px
    --faifo-text-sm, --faifo-text-base13px--faifo-line-sm 20px
    --faifo-text-md, --faifo-text-lg14px--faifo-line-md 20px
    --faifo-text-xl20px--faifo-line-xl 24px
    --faifo-text-2xl24px--faifo-line-2xl 32px
    --faifo-text-3xl30px--faifo-line-3xl 40px
    --faifo-text-4xl36px--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

    TokenValueGroup
    --faifo-font-sans"Porto Faifo Sans", "Porto Faifo Sans Fallback", "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serifTypography
    --faifo-font-displayvar(--faifo-font-sans)Typography
    --faifo-font-mono"Porto Faifo Mono", "Porto Faifo Mono Fallback", "SFMono-Regular", Consolas, "Liberation Mono", monospaceTypography
    --faifo-text-2xs0.6875remTypography
    --faifo-text-xs0.75remTypography
    --faifo-text-sm0.8125remTypography
    --faifo-text-md0.875remTypography
    --faifo-text-base0.8125remTypography
    --faifo-text-lg0.875remTypography
    --faifo-text-xl1.25remTypography
    --faifo-text-2xl1.5remTypography
    --faifo-text-3xl1.875remTypography
    --faifo-text-4xl2.25remTypography
    --faifo-line-2xs0.75remTypography
    --faifo-line-xs1remTypography
    --faifo-line-sm1.25remTypography
    --faifo-line-md1.25remTypography
    --faifo-line-lg1.25remTypography
    --faifo-line-xl1.5remTypography
    --faifo-line-2xl2remTypography
    --faifo-line-3xl2.5remTypography
    --faifo-line-4xl3remTypography
    --faifo-page-title-sizevar(--faifo-text-2xl)Typography
    --faifo-page-title-linevar(--faifo-leading-tight)Typography
    --faifo-leading-tight1.2Typography
    --faifo-leading-normalcalc(20 / 13)Typography
    --faifo-leading-relaxed1.6Typography
    --faifo-weight-normal400Typography
    --faifo-weight-medium500Typography
    --faifo-weight-semibold600Typography
    --faifo-weight-bold700Typography
    --faifo-input-font-sizevar(--faifo-text-sm)Typography
    --faifo-input-line-heightvar(--faifo-line-sm)Typography
    --faifo-label-font-sizecalc(var(--faifo-input-font-size) - 1px)Typography
    --faifo-action-font-sizevar(--faifo-text-sm)Typography
    --faifo-action-line-heightvar(--faifo-line-sm)Typography