Skip to content

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

Swyddogaeth: simpleIcons()

simpleIcons(options?): PantokenPlugin

Bêta

Creu'r ategyn Simple Icons.

Paramedrau

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Paswch registry i osgoi'r mewnforio hwyr (er enghraifft yn defnydd token-stage, lle mae'r hooks yn synchroonaidd).

Yn dychwelyd

PantokenPlugin

A PantokenPlugin gyda hooks tokens a rehype.

Enghreifftiau

Allbwn glyfachau brand fel <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

Datrys codau :brand: wrth rendro (haen 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" }