feat: rootpage #16
No files matched your search
@@ -0,0 +1,76 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Icons via Nuxt Icon
|
||||
description: Every icon comes from @nuxt/icon with the Material Symbols collection installed locally; the self-hosted icon webfont, its @font-face and its CSS class are gone.
|
||||
tags: [decision, ui, icons, nuxt, payload]
|
||||
status: stable
|
||||
generated: { by: opencode-go/deepseek-v4.1-flash, at: 2026-10-23T00:00:00Z }
|
||||
verified: { by: human:noel, at: 2026-10-23T00:00:00Z }
|
||||
sources:
|
||||
- id: config
|
||||
resource: nuxt.config.ts
|
||||
title: Icon module registration and options
|
||||
- id: consumer
|
||||
resource: app/components/AppBottomNav.vue
|
||||
title: First and only icon consumer so far
|
||||
- id: package
|
||||
resource: package.json
|
||||
title: "@nuxt/icon and @iconify-json/material-symbols"
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
Icons come exclusively from `@nuxt/icon`. The icon set is Material Symbols,
|
||||
installed as a local collection (`@iconify-json/material-symbols`), and names are
|
||||
written in full inside components:
|
||||
|
||||
```vue
|
||||
<Icon name="material-symbols:badge" aria-hidden="true" class="text-[22px]" />
|
||||
```
|
||||
|
||||
The previously self-hosted Material Symbols webfont is deleted:
|
||||
`public/fonts/material-symbols-outlined-var.woff2`, its `@font-face` in
|
||||
`app/assets/css/main.css`, and the `.material-symbols-outlined` class.
|
||||
|
||||
# Why
|
||||
|
||||
* **One icon system.** The nav rendered webfont glyphs by text content while
|
||||
everything else in the app is Tailwind utilities; a ligature typo silently
|
||||
produced a blank box.
|
||||
* **Payload.** The font was 3.9 MiB for three glyphs. The bundled icon data for
|
||||
the same three is 1.23 kB.
|
||||
* **Self-hosting.** The module's defaults are not local: `mode: "css"`, provider
|
||||
`server`, `iconifyApiEndpoint: https://api.iconify.design` and
|
||||
`fallbackToApi: true`. Without an installed collection the site would call a
|
||||
third-party CDN at runtime, which is the same problem the self-hosted text
|
||||
fonts were chosen to avoid.
|
||||
|
||||
# Configuration
|
||||
|
||||
| Option | Value | Effect |
|
||||
|---|---|---|
|
||||
| `mode` | `'svg'` | The icon is an inline `<svg>` in the SSR HTML, so it survives with JavaScript disabled. CSS mode would have fetched icon data on the client and painted after hydration. |
|
||||
| `serverBundle` | `{ collections: [] }` | `'auto'` bundles every installed collection server-side; with only `material-symbols` installed that was an 8 MB `icons.mjs`. Empty means no server-side icon data at all. |
|
||||
| `clientBundle` | `{ scan: true }` | Bundles only the icons named in source. The build reports `Nuxt Icon client bundle consist of 3 icons with 1.23KB(uncompressed) in size`. |
|
||||
|
||||
# Consequences
|
||||
|
||||
* Sizing is `text-[…]` on the `<svg>`: the component renders `width="1em"
|
||||
height="1em"`, so font-size is the icon size.
|
||||
* Adding another Material Symbols icon is a code change only — the scanner picks
|
||||
the name up and the next build bundles it.
|
||||
* A different icon set means `pnpm add @iconify-json/<set>` plus new names; no
|
||||
other configuration changes.
|
||||
* Decorative icons carry `aria-hidden="true"`, because every icon sits next to a
|
||||
text label.
|
||||
|
||||
# Not verified
|
||||
|
||||
* That the bars look right at 22px on a real phone — checked in the SSR HTML and
|
||||
the build output only.
|
||||
|
||||
# Revisit when
|
||||
|
||||
* A second icon set is wanted (two collections, two packages, no config change).
|
||||
* Many icons push the client bundle up: the alternative is `mode: 'css'`, which
|
||||
ships class names and fetches icon data once instead of inline SVG per icon.
|
||||
@@ -11,3 +11,4 @@
|
||||
* [Production image shape](production-image.md) - Multi-stage, digest-pinned, non-root runnable Node server; measured build and serve.
|
||||
* [Repository and compose layout](repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
|
||||
* [Mockup layout](mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
|
||||
* [Icons via Nuxt Icon](icons-via-nuxt-icon.md) - Every icon comes from `@nuxt/icon` with the Material Symbols collection installed locally; the 3.9 MiB icon webfont is gone and three icons cost 1.23 kB.
|
||||
@@ -32,6 +32,10 @@ config files — the configs say what, these documents say why.
|
||||
* [Repository and compose layout](decisions/repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
|
||||
* [Mockup layout](decisions/mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
|
||||
|
||||
## UI and icons (2026-10-23)
|
||||
|
||||
* [Icons via Nuxt Icon](decisions/icons-via-nuxt-icon.md) - Icons come only from `@nuxt/icon` with a locally installed Material Symbols collection; inline SVG for SSR, scanned client bundle, and no icon webfont.
|
||||
|
||||
# The one-paragraph history
|
||||
|
||||
The repository started as the Nuxt app shell. Docker development (dev
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Update Log
|
||||
|
||||
## 2026-10-23 (icons from Nuxt Icon, icon webfont removed)
|
||||
* **Decision**: Recorded [Icons via Nuxt Icon](decisions/icons-via-nuxt-icon.md) - all icons come from `@nuxt/icon` with `@iconify-json/material-symbols` installed locally, `mode: 'svg'`, `serverBundle: { collections: [] }`, `clientBundle: { scan: true }`. Deleted `public/fonts/material-symbols-outlined-var.woff2` (3.9 MiB), its `@font-face` and the `.material-symbols-outlined` class in `app/assets/css/main.css`. Build reports 3 icons, 1.23 kB; SSR HTML carries the inline `<svg>`.
|
||||
* **Update**: The module's defaults would have called `api.iconify.design` at runtime (`mode: css`, `fallbackToApi: true`), which the local collection avoids; `serverBundle: 'auto'` would have bundled the whole set as an 8 MB server chunk.
|
||||
|
||||
## 2026-10-20 (cheaper review model, cached installs, merged checks)
|
||||
* **Update**: [pr-checker.yml](../.gitea/workflows/pr-checker.yml) - the review model is now `opencode-go/claude-haiku-5-5#medium`: cheap per token and, unlike `deepseek-v4.1-flash`, it has a real `#medium` effort level (flash exposes only low/high/max). ESLint and typecheck are merged into one `checks` job with a single `pnpm install`, and the pnpm store plus the opencode binary are restored with `actions/cache@v4.1.0` (v1 cache API, so it also works on a v1-only runner). Cache keys are built from `sha256sum pnpm-lock.yaml`, the pnpm store layout (`v11`) and the opencode version in shell steps, because `hashFiles()` evaluates empty in this act runner. See [AI review setup](decisions/ai-review-setup.md) and [PR pipeline layering](decisions/pr-pipeline-layering.md).
|
||||
|
||||
|
||||
Reference in new issue
Block a user