@pantoken/plugin-custom-icons
v0.3.6
Published
pantoken plugin: vendored custom icon glyphs (e.g. product/brand icons not in the InstUI set) as --instui-icon-<name> image tokens, usable via the same -icon-<name> painter class.
Downloads
1,367
Readme
@pantoken/plugin-custom-icons
A pantoken plugin that vendors custom icon glyphs — product/brand marks or anything else not in the
InstUI icon set — as --instui-icon-<name> image tokens. It reuses the same token namespace and
.-icon-<name> painter class as the built-in InstUI icons and Simple Icons, so a custom icon drops
into .instui-icon -icon-<name> exactly like a built-in one. No custom- prefix: on a name
collision, the built-in InstUI icon wins.
Install
npm i @pantoken/plugin-custom-iconsAlso available as pantoken/customIcons.
Usage
Emit vendored icons as <image> tokens (they then flow to CSS and native too):
import { buildTokens } from "@pantoken/core";
import { customIcons } from "@pantoken/plugin-custom-icons";
buildTokens({
theme: "rebrand",
plugins: [customIcons({ names: ["highspot"] })],
});
// adds --instui-icon-highspot as an <image> tokenOr load the static CSS directly from the CDN — either the full barrel or a single icon:
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@pantoken/plugin-custom-icons/dist/custom-icons.css"
/>
<!-- or just one icon -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@pantoken/plugin-custom-icons/dist/icons/highspot.css"
/>
<span class="instui-icon -icon-highspot"></span>API
customIcons(options?): PantokenPlugin— create the plugin, with atokenshook.CustomIconsOptions—names(icon names to emit as tokens, default: every vendored icon) andprefix(token-name prefix, default--instui-icon-).icons: readonly CustomIcon[]— every vendored icon's{ name, svg }metadata.
Icons
conveyorhighspotresponsivevanilla-forums
