Skip to content

pantoken / renderers/react-native/src / tokensForScheme

Função: tokensForScheme()

tokensForScheme(scheme): Record<string, RNTokenValue>

Experimental

Selecione o objeto de token para um esquema de cores (combine com o useColorScheme do RN).

Parâmetros

scheme

"light" | "dark" | null | undefined

Retorna

Record<string, RNTokenValue>

Exemplo

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