Skip to content

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

Ֆունկցիա: simpleIcons()

simpleIcons(options?): PantokenPlugin

Բետա

Ստեղծել Simple Icons plugin-ը։

Պարամետրեր

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Փոխանցեք registry, որպեսզի խուսափեք lazy ներմուծումից (օր. token-stage օգտագործման դեպքում, որտեղ hooks-ները սինխրոն են).

Վերադարձվող արժեք

PantokenPlugin

Մեկ PantokenPlugin tokens և rehype hooks-ներով։

Օրինակներ

Արտահանել ապրանքանիշի գլիֆները որպես <image> tokens

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