Skip to content

pantoken / plugins/pantoken/simple-icons/src / simpleIcons

Fonksyon: simpleIcons()

simpleIcons(options?): PantokenPlugin

Beta

Kreye plugin Simple Icons la.

Paramèt

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Pase a registry pou evite enpòte parese a (pa egzanp nan itilizasyon token-stage, kote hooks yo senkron).

Retounen

PantokenPlugin

Yon PantokenPlugin ak hooks tokens ak rehype.

Egzanp

Emèt glif mak kòm <image> tokèn

ts
import { buildTokens } from "@pantoken/core/build";
import { simpleIcons } from "@pantoken/plugin-simple-icons";
import * as registry from "simple-icons";

buildTokens({
  theme: "rebrand",
  plugins: [simpleIcons({ registry, slugs: ["github", "react"] })],
});
// adds --instui-icon-github, --instui-icon-react as <image> tokens

Rezoud kòd :brand: pandan rann (kouch rehype)

ts
import { simpleIcons } from "@pantoken/plugin-simple-icons";
import * as registry from "simple-icons";

const { resolve } = simpleIcons({ registry }).rehype!({ resolve: () => undefined });
resolve("github"); // { name, path, svg, viewBox, source: "simple-icons" }