Skip to content

theme/runtime-icons

import { … } from 'zidane-ui'ui/src/theme/runtime-icons.ts

Functions#

watchRuntimeIconsFunction#

Draws the i-ph-* icon classes no stylesheet styles, as they appear under root (see the module comment). Call it once, at startup.

TypeScript
function watchRuntimeIcons(options: RuntimeIconsOptions): () => void
Parameters
NameTypeDescription
optionsRuntimeIconsOptions

The collection's loader, and the element to watch.

() => void

Stops watching. The rules already added stay.

ui/src/theme/runtime-icons.ts:82

Interfaces#

IconCollectionInterface#

An Iconify collection, as @iconify-json/<prefix>/icons.json holds it.

TypeScript
interface IconCollection
IconCollection properties
NameTypeDescription
aliases?Readonly<Record<string, { parent: string }>>

Other names of its icons.

height?number

The default height of its icons.

iconsReadonly<Record<string, { body: string; height?: number; width?: number }>>

Its icons, by name: each one's SVG body.

width?number

The default width of its icons.

ui/src/theme/runtime-icons.ts:15

RuntimeIconsOptionsInterface#

Options of watchRuntimeIcons.

TypeScript
interface RuntimeIconsOptions
RuntimeIconsOptions properties
NameTypeDescription
loadPhosphor() => Promise<IconCollection>

Loads the Phosphor collection (@iconify-json/ph's icons.json), transformed as the app's Uno config transforms it (crispPhosphor), so a runtime icon looks like a built one.

root?Element

The element to watch. Default: the document's root element.

ui/src/theme/runtime-icons.ts:27