shtukbasehub

Page icons

Icons for pages, as in Notion and further: an emoji, an icon from a shared set or an SVG an agent draws for the page. Tiers say which pages get which, so 20 000 service pages never get bespoke art; norms with checks, a prompt for the agent, validate and sanitize for SVG. Style-agnostic: a style plugs in with an IconStyle page; an icon set follows the convention icon-set (a registry, flat drawings, no plate), and the icon lens shows every set in every style.

Packageiconsv0.2.225 files

Page icons

A page shows a small icon next to its title: in the sidebar, in lists and links, in the card and in the page header. The package says what an icon may be, which pages get which kind of icon, where the files lie, and checks it. The full explanation is the page /base/icons.md; the settings are /design/icons.md.

What an icon is. The field icon: of a page: one emoji (icon: "๐Ÿฅ•") or a path to an SVG file (icon: /assets/icons/carrot.svg). The field art: is a large picture for cards, a path to an SVG too. Files lie in /assets/icons/; the shared set of uniform icons lies in /assets/icons/set/. Nothing is inlined in the front matter.

Tiers. A collection says in its page how its records get icons: icons: {tier: kind, item: "๐Ÿƒ"}. none โ€” no icon; kind โ€” all records show the collection's one icon; pick โ€” a record picks an emoji or a set icon; bespoke โ€” a picture is drawn for the record, at most max files per collection. A collection without icons: gets defaultTier (pick): a drawing for a page is always a decision someone wrote down.

For agents. Before giving a page an icon run shtuk run icons prompt <page.md>: it says the page's tier and prints what to do โ€” nothing, one emoji, or a drawing prompt with the contract and the style. After drawing: shtuk run icons validate <file>; a file from elsewhere: shtuk run icons sanitize <file> --write.

What is checked

  • ICN-R01 (MUST, enforce): icon and art of every page, icons.item of every collection and every .svg in the icons folder: the file exists, lies in /assets/icons/, is an SVG by the contract โ€” square viewBox, xmlns, at most maxBytes (4096), only drawing elements, no script, event attributes, links out of the file, text, <style>, <image> or currentColor; with an icon style installed, colours from its palette. The valid check.
  • ICN-R02 (MUST, enforce): a page carries only what its tier allows, and the bespoke files of a collection are at most its max. The budget check.
  • ICN-R03 (SHOULD, enforce): in a collection with icons: {required: true} every record shows an icon: its own, or the inherited one. The required check.
  • ICN-R04 (SHOULD, warn): an icon set and its registry agree โ€” every drawing has a record and every record its file, a name or an alias belongs to one icon, every record says what it draws and where it fits; near duplicates are reported. The registry check; it reports and never fails (the health of the convention).

Style

The package draws nothing itself and has no palette. A style package plugs in with a page type: IconStyle under /design/ (or the one named by style: in the settings): palette, viewBox, gradients, rules (lines for the drawing prompt), examples. The prompt quotes it; the checks hold the palette. Without a style the contract alone holds.

An IconStyle page may also say role (base, the default; variant or reserve, which are shown but never held by default), styleId, set (the registry it draws) and render, the parameters of the renderer lib/render.js: outline (ink, deep, hueink or a colour), outlineWidth, rim, rimColor, shadow, offset, shadowOnly, scale. A palette entry that is a list is a hue: main, dark, light, deep, deeper. The renderer is pure JavaScript with no DOM: the same file renders a set in a build and in the lens.

Icon sets: the convention

An icon set (for example shtukbase-icons) keeps the convention icon set: flat drawings in /design/<set>/flat/, one registry /design/<set>/registry.json (a record per icon: name, file, description, use, avoid, aliases, group, added), names by Lucide where Lucide has the concept, no plate under an icon. The prompt searches the registries first and prints the reuse rules; the agent draws only when no record means the same thing.

The icon lens

/design/icons.html shows every set by colour group, each icon at the chosen size on a light and a dark surface, in the held style or in every installed style side by side; search by name, alias and meaning; a click shows the record and copies the name. The settings are in the explore panel (explore-kit; without it, plain fields). Build its data with shtuk run icons lens.

Where the boundary is

  • Here: the fields, tiers, storage, the SVG contract, the checks, the prompt, validate and sanitize, the renderer, the convention for icon sets and the icon lens.
  • A set and its style: a set package such as shtukbase-icons.
  • How icons are shown in lenses is in the lens kit (lenses): emoji as text, SVG through <img>, the fallback is the record's icon โ†’ the collection's icons.item โ†’ the collection page's icon โ†’ ๐Ÿ“„.
  • The look of icons is the style package's.