@fest-lib/icon
v0.1.31
Published
fest-lib Phosphor ui-icon with OPFS and CSS-registry caches
Maintainers
Readme
Default export is UIPhosphorIcon. Glyphs come from @phosphor-icons/core (bundled dependency). First paint can prefetch; later loads read OPFS / the CSS registry.
core · dom · object · lure · uniform
└── fest/icon ← you are here
└── fl-ui · Speed Dial · App MenuInstall
npm install @fest-lib/core @fest-lib/dom @fest-lib/object @fest-lib/uniform @fest-lib/lure @fest-lib/iconPeers: core, dom, object, uniform. Runtime also uses LUR.E (listed as a dependency).
import UIPhosphorIcon, { prefetchIcon, getIconCacheStats } from "@fest-lib/icon";
if (!customElements.get("ui-icon")) {
customElements.define("ui-icon", UIPhosphorIcon);
}
await prefetchIcon("house");
console.log(getIconCacheStats());<ui-icon icon="house" icon-style="duotone"></ui-icon>API
| Export | Role |
| --- | --- |
| UIPhosphorIcon (default) | custom element |
| prefetchIcon / invalidateIconCache / clearIconCaches | memory loader |
| initOPFSCache / clearIconCache / getIconCacheStats | OPFS |
| registerIconRule / preregisterIcons / getRegistryStats | CSS registry |
| isOPFSSupported | feature detect |
Layout
| Path | Role |
| --- | --- |
| src/loader/Phosphor.ts | <ui-icon> |
| src/loader/OPFSCache.ts | OPFS |
| src/loader/Loader.ts | in-memory load |
| src/loader/CSSIconRegistry.ts | stylesheet rules |
Workspace
cd modules/projects/icon.ts
npm run generate:phosphor-map
npm run dev
npm run build
npm run publishLicense: MIT.
