Skip to content

pantoken / platforms/android/src / toAndroid

Fall: toAndroid()

toAndroid(tokens, options): Promise<string[]>

Tilrauna

Búa til Android resource XML fyrir tilgreint token-IR.

Færibreytur

tokens

readonly Token[]

options

GenerateAndroidOptions

Skilar

Promise<string[]>

Slóðir fyrir rituðu colors.xml og dimens.xml.

Dæmi

Búa til IR fyrir tiltekið þema

ts
import { toAndroid } from "@pantoken/android";
import { byTheme } from "@pantoken/tokens";

const [colors, dimens] = await toAndroid(byTheme("canvas"), { outDir: "./app/src/main" });
// writes ./app/src/main/res/values/colors.xml and dimens.xml

Dökkur hamur með VectorDrawable-táknum

ts
import { toAndroid } from "@pantoken/android";
import { byTheme } from "@pantoken/tokens";

await toAndroid(byTheme("rebrand"), {
  outDir: "./app/src/main",
  mode: "dark",
  icons: ["add", "check"], // also emits res/drawable/ic_add.xml, ic_check.xml
});