Skip to content

pantoken / formats/components/src / iconGlyphsCss

ฟังก์ชัน: iconGlyphsCss()

iconGlyphsCss(names, options?): string

เบต้า

Build the icon-glyph stylesheet: one .<prefix>-icon-<name> class per icon that points --pantoken-glyph at the matching --instui-icon-<name> token. Kept out of the component bundle (it's large); ships as its own icons.css. Pass the icon names (e.g. from @pantoken/icons).

พารามิเตอร์

names

readonly string[]

ชื่อไอคอนโดยไม่มีพรีฟิก --instui-icon- (เช่น ["megaphone", "check"]).

options?

IconGlyphsOptions = {}

IconGlyphsOptions (เพิ่ม deprecatedAliases ไปยัง ComponentOptions).

คืนค่า

string

สตริง CSS.

ตัวอย่าง

ts
import { iconGlyphsCss } from "@pantoken/components";
import { icons } from "@pantoken/icons";

const css = iconGlyphsCss(icons.map((i) => i.name)); // .-icon-megaphone { --pantoken-glyph: … }

This is the glyph-token half of the icon system (the .-icon-<name> modifiers, shipped as icons.css); the icon utility is the painter half (the shared ::before). They share the icon demo.