Skip to content

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

Mahi: simpleIcons()

simpleIcons(options?): PantokenPlugin

Beta

Waihanga i te taapiri Simple Icons.

Ngā Tawhā

options?

SimpleIconsOptions = {}

SimpleIconsOptions. Tukua he registry kia karo i te kawemai hāngū (hei tauira i te whakamahinga token-stage, kei reira ngā hooks he tūturu).

Whakahokia

PantokenPlugin

He PantokenPlugin me ngā hooks tokens me rehype.

Ngā tauira

Tukuna ngā whakairo tohu waitohu hei tohu <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

Whakatau ngā waehere :brand: i te wā whakairo (papanga 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" }