diff --git a/docs/content/1.guide/2.devframe-definition.md b/docs/content/1.guide/2.devframe-definition.md index 14c17133..6180023c 100644 --- a/docs/content/1.guide/2.devframe-definition.md +++ b/docs/content/1.guide/2.devframe-definition.md @@ -39,7 +39,7 @@ export default defineDevframe({ ## Definition fields -`id`, `name`, `version`, `packageName`, `homepage`, `description`, and `setup` are required; pass `importMetaUrl: import.meta.url` so [remote assets](/guide/client-assets) and declared [services](/guide/services#wire-services) resolve against the devframe's own dependencies. The remaining fields cover display (`icon`), mounting (`basePath`, `duplicationStrategy`, `capabilities`), what the devframe consumes and serves (`services`, `clientAssets`, `rpc.snapshot`), and [CLI defaults](#cli-options) (`cli`). Every field is listed in the [Node-Side API reference](/references/node-api#definition-fields). +`id`, `name`, `version`, `packageName`, `homepage`, `description`, and `setup` are required; pass `importMetaUrl: import.meta.url` so [remote assets](/guide/client-assets) and declared [services](/guide/services#wire-services) resolve against the devframe's own dependencies. The remaining fields cover display (`icon`, [Icon values](/references/node-api#icon-values)), mounting (`basePath`, `duplicationStrategy`, `capabilities`), what the devframe consumes and serves (`services`, `clientAssets`, `rpc.snapshot`), and [CLI defaults](#cli-options) (`cli`). Every field is listed in the [Node-Side API reference](/references/node-api#definition-fields). ### Sourcing metadata from `package.json` diff --git a/docs/content/8.references/4.node-api.md b/docs/content/8.references/4.node-api.md index cdb6bf03..54e5475a 100644 --- a/docs/content/8.references/4.node-api.md +++ b/docs/content/8.references/4.node-api.md @@ -20,7 +20,7 @@ The fields of a `DevframeDefinition`: [Devframe Definition](/guide/devframe-defi | `importMetaUrl` | `string` | **Recommended.** Pass `import.meta.url`, the deps resolution base: default `resolveFrom` for [remote assets](/guide/client-assets) and declared [services](/guide/services#wire-services). | | `homepage` | `string` | **Required.** Homepage/docs URL. | | `description` | `string` | **Required.** One-line summary. | -| `icon` | `string \| { light, dark }` | Optional Iconify name or URL; light/dark pairs. | +| `icon` | `string \| { light, dark }` | Optional Iconify name, image URL, light/dark pairs, etc. See [Icon values](#icon-values). | | `basePath` | `string` | Optional mount-path override. Default `/` standalone (`cli`/`build`), `/__/` hosted (`vite`/`embedded`). | | `duplicationStrategy` | `'warn' \| 'silent' \| 'throw' \| 'duplicate'` | Hub reaction when another devframe shares this `id`. Default `'warn'`. See [Duplication strategies](/references/hub-api#duplication-strategies); standalone adapters ignore it. | | `capabilities` | `{ dev?, build? }` | Per-runtime feature flags. `boolean` = whole runtime; object = individual features. | @@ -30,6 +30,20 @@ The fields of a `DevframeDefinition`: [Devframe Definition](/guide/devframe-defi | `setup` | `(ctx, info?) => void \| Promise` | **Required.** Server-side entry point, run in every runtime. Optional 2nd arg carries runtime metadata, notably parsed CLI `flags` under `createCac`. | | `cli` | `DevframeCliOptions` | CLI adapter defaults. See [CLI options](#cli-options). | +## Icon values + +The `icon` field, and every dock entry, command, and terminal icon, accept the same string forms. A `{ light, dark }` pair picks the matching variant per active color scheme, and each side takes any of these forms: + +| Form | Example | Rendered as | +|---|---|---| +| Iconify name | `ph:gauge-duotone`, `logos:nuxt-icon` | the `collection:icon` glyph, fetched from Iconify as inline SVG | +| Image URL | `/icons/logo.svg`, `https://example.com/logo.png` | an ``; relative URLs resolve against the supplying hub | +| Data URL | `data:image/svg+xml,%3Csvg…%3E` | an inline `` from the embedded data | +| SVG mask | `mask:/icons/logo.svg`, `mask:data:image/svg+xml,%3Csvg…%3E` | an alpha mask tinted with `currentColor`, following the surrounding text color | +| Light/dark pair | `{ light: './logo-light.svg', dark: './logo-dark.svg' }` | the variant matching the active color scheme; each side is any string form above | + +The reference hub UI and terminal SPA render `mask:` icons with the surrounding text color, preserving the image's shape and opacity, so a bundled monochrome SVG follows the dock's foreground color through selected and dimmed states. For a bundled SVG, use `` `mask:data:image/svg+xml,${encodeURIComponent(svg)}` ``. A mask produces one color; use an ordinary image URL for multicolor artwork. Relative mask URLs on dock entries resolve against the supplying hub's URL. Custom hub UI providers implement this string convention in their own icon renderer. + ## CLI options The `cli` field's `DevframeCliOptions`: [CLI options](/guide/devframe-definition#cli-options). diff --git a/docs/content/8.references/6.hub-api.md b/docs/content/8.references/6.hub-api.md index bb1ee1bf..9a001e2c 100644 --- a/docs/content/8.references/6.hub-api.md +++ b/docs/content/8.references/6.hub-api.md @@ -145,7 +145,7 @@ The origin-locked `postMessage` protocol on `devframe:frame-nav`: [Shared-iframe ## Dock entry types -The built-in variants of the open dock union (`DevframeDockEntryRegistry`, `@devframes/hub/types`) a hub UI provider renders: [Build Your Own Hub UI](/guide/build-your-own-hub-ui). +The built-in variants of the open dock union (`DevframeDockEntryRegistry`, `@devframes/hub/types`) a hub UI provider renders: [Build Your Own Hub UI](/guide/build-your-own-hub-ui). Each entry's `icon` takes any of the [icon values](/references/node-api#icon-values). | Type | The hub UI provider renders | |---|---| diff --git a/packages/hub-ui/src/client/components/icons/IconifyIcon.vue b/packages/hub-ui/src/client/components/icons/IconifyIcon.vue index 157d23dc..99c4f866 100644 --- a/packages/hub-ui/src/client/components/icons/IconifyIcon.vue +++ b/packages/hub-ui/src/client/components/icons/IconifyIcon.vue @@ -1,4 +1,5 @@