# 0045. FontAwesome is subset to the icons in use

- **Status:** Accepted
- **Date:** 2026-09-24

## Context

The frontend shipped FontAwesome Pro's solid, regular and brands sets in full — about 680 KB of webfont and the
CSS for four thousand icons — for about a hundred.

## Decision

As Molino (its ADR 0045): `./yii dev/icons` collects icon names from the source and every text column and writes
`resources/icons.json`; `npm run icons` (`bin/build-icons.js`) writes `_fontawesome-icons.scss` and the subset
fonts into `resources/fonts/`. `fontawesome-subset.scss` replaces the full import in `common.scss`; the admin
imports the full set. Here in addition:

- An icon name handed to `i()` through a variable or an array is **written with its `fa-` prefix**, so the
  collector sees it.
- Glyphs a stylesheet draws by code point (`content: "\f0d7"`) are collected too.
- The `font_awesome_icon` table is older than the installed package; names it lacks are resolved from the
  package's own metadata.
- The dashboard warns about an icon picked on a content, storage type or property group that the subset lacks.

## Alternatives

- **Restrict the admin icon picker to the subset.** Every new icon becomes a developer round trip.
- **Inline SVG for everything** (ADR 0037's mechanism). Right for the design's own icons; the icons chosen in
  the admin have no SVG on the server.

## Consequences

- A new icon in a view means `dev/icons`, `npm run icons` and a rebuild; `dev/icons --check` catches a miss.
- An icon name assembled at runtime from parts is invisible to the collector.
