Skip to content

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

Funkcija: simpleIcons()

simpleIcons(options?): PantokenPlugin

Beta

Ustvari vtičnik Simple Icons.

Parametri

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Posredujte registry, da se izognete lenemu uvozu (npr. pri uporabi v token-stage, kjer so hooks sinhroni).

Vrne

PantokenPlugin

A PantokenPlugin z hooki tokens in rehype.

Primeri

Oddaj glyph-e blagovne znamke kot <image> tokeni

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

Razreši kode :brand: pri upodabljanju (rehype plast)

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