Media / API

foldkit-media/icons

SVG to IconData, for builds and generator scripts: a Vite plugin reading an icon set, a script writing a package's icon constants. The parse is where an icon is checked, because it is drawn inline: an element or attribute outside the presentational allowlist, a style, an event attribute, or a reference outside the icon fails here, naming the icon, rather than being dropped.

Functions

fromIconifyThe icon name of an Iconify set, through its aliases, each of which may give its own box. An alias that rotates or flips its parent is refused rather than…
namesOfEvery name the set draws: its icons, then its aliases.
parseThe icon in svg, one whole SVG document, as IconData; name says which icon a refusal is about. Throws on anything outside the allowlist.

Values

IconifySetAn Iconify set, as its JSON file holds it (@iconify-json/<prefix>/icons.json). What the drawing does not need (info, categories, an icon's hidden) is read past.