Skip to content

pantoken / packages/core/src / collectIcons

函数: collectIcons()

collectIcons(options?): IconLayer

Beta

收集统一的 InstUI 图标层。自定义字形优先于同名的 Lucide 字形。输出按名称排序以确保确定性结果。

参数

options?

CollectIconsOptions = {}

返回值

IconLayer

示例

收集每个字形及图标颜色的特殊值

ts
import { collectIcons } from "@pantoken/core";

const { glyphs, colors } = collectIcons();
// glyphs → IconToken[] (Custom + Lucide, name-sorted)
// colors → [["--instui-icon-color-ai", "…"], ["--instui-icon-color-inherit", "currentColor"]]

仅限 Instructure 创作的字形

ts
import { collectIcons } from "@pantoken/core";

const { glyphs } = collectIcons({ includeLucide: false });
// → only the Custom (Instructure-authored) glyphs