Skip to content

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

Fonksiyon: simpleIcons()

simpleIcons(options?): PantokenPlugin

Beta

Simple Icons eklentisini oluşturun.

Parametreler

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Tembel içe aktarmayı önlemek için registry ile geçin (ör. token-stage kullanımında, kancalar eşzamanlı olduğunda).

Döndürür

PantokenPlugin

tokens ve rehype kancalarına sahip bir PantokenPlugin.

Örnekler

Marka gliflerini <image> token'ları olarak yayınlayı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

Render sırasında (rehype katmanında) :brand: kodlarını çözümleyin

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" }