Skip to content

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

फंक्शन: simpleIcons()

simpleIcons(options?): PantokenPlugin

बीटा

Simple Icons प्लगइन बनाएँ।

पैरामीटर

options?

SimpleIconsOptions = {}

SimpleIconsOptions. registry पास करें ताकि लेज़ी इम्पोर्ट से बचा जा सके (उदाहरण के लिए token-stage उपयोग में, जहाँ hooks सिंक्रोनस होते हैं)।

वापसी

PantokenPlugin

एक PantokenPlugin जिसमें tokens और rehype हुक्स हों।

उदाहरण

ब्रांड ग्लिफ़्स को <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

रेंडर पर :brand: कोड्स को सुलझाएँ (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" }