Skip to content

pantoken / renderers/react-native/src / tokensForScheme

Mahi: tokensForScheme()

tokensForScheme(scheme): Record<string, RNTokenValue>

Whakamātautau

Tīpakohia te tūtohu token mō tētahi rārangi tae (honohono ki te useColorScheme o RN).

Ngā Tawhā

scheme

"light" | "dark" | null | undefined

Whakahokia

Record<string, RNTokenValue>

Tauira

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