Skip to content

pantoken / renderers/react-native/src / tokensForScheme

Függvény: tokensForScheme()

tokensForScheme(scheme): Record<string, RNTokenValue>

Kísérleti

Válassza ki a token objektumot egy szín sémához (párosítsa RN useColorScheme-ével).

Paraméterek

scheme

"light" | "dark" | null | undefined

Visszatérés

Record<string, RNTokenValue>

Példa

tsx
import { useColorScheme } from "react-native";
import { tokensForScheme } from "@pantoken/react-native";

const t = tokensForScheme(useColorScheme());
const styles = { card: { backgroundColor: t.colorBackgroundBase, padding: t.spacingSpaceMd } };