Skip to content

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

دالة: simpleIcons()

simpleIcons(options?): PantokenPlugin

بيتا

إنشاء المكوّن الإضافي Simple Icons.

المعلمات

options?

SimpleIconsOptions = {}

SimpleIconsOptions. مرّر registry لتجنّب الاستيراد الكسول (مثلاً في استخدام token-stage، حيث الخطافات متزامنة).

القيم المرجعة

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