Skip to content

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

Feidhm: simpleIcons()

simpleIcons(options?): PantokenPlugin

Béite

Cruthaigh an breiseán Simple Icons.

Paraiméadair

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Seol registry chun an iompórtáil leisciúil a sheachaint (m.sh. i úsáid token-stage, áit a mbíonn hooks sínchrónacha).

Tuairisceáin

PantokenPlugin

Breiseán PantokenPlugin le hooks tokens agus rehype.

Samplaí

Seol glyfanna branda mar thóicíní <image>.

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

Réitigh cóid :brand: ag an rindreáil (sraith 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" }