Skip to content

pantoken / renderers/react-native/src / tokensForScheme

Ֆունկցիա: tokensForScheme()

tokensForScheme(scheme): Record<string, RNTokenValue>

Փորձարկումային

Ընտրել մեջբերում օբյեկտ գույնի սխեմայի համար (զույգ RN's useColorScheme-ի հետ)։

Պարամետրեր

scheme

"light" | "dark" | null | undefined

Վերադարձվող արժեք

Record<string, RNTokenValue>

Օրինակ

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