Skip to content

feat(tokens): add font-variant-numeric: tabular-nums token + utility #214

Description

@jackgranatowski

Summary

Numeric digits in most fonts have proportional widths by default (1 is narrower than 8). In price columns, order tables, and invoices this causes digits to misalign vertically. tabular-nums enforces uniform digit width.

Current state

optional/forms.css styles <input type="number"> but does not apply tabular numerics anywhere. There is no token or utility for this.

Proposed change

  1. Add a token to core/tokens.css:
--sf-font-numeric: tabular-nums;
  1. Add a utility class to optional/utilities.css:
.sf-tabular-nums { font-variant-numeric: var(--sf-font-numeric, tabular-nums); }
  1. Optionally apply it automatically on <input type="number"> in optional/forms.css.

Why it matters

Critical for e-commerce — price lists, cart totals, invoices, dashboards. Numbers in a column look broken without it. Full browser support, zero risk.

Browser support

Universal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions