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