Julius MarmingeT3 Code Mobile [WIP] (#2013)b3e8c035 months agoHistory
12 lines · 439 B · TypeScript
RawDownload
import type { ColorValue } from "react-native";import { useCSSVariable } from "uniwind"; /** * Typed wrapper around `useCSSVariable` that returns a `ColorValue` for use * in React Native style props (backgroundColor, tintColor, etc.). * * Usage: `const color = useThemeColor("--color-icon");` */export function useThemeColor(variable: `--color-${string}`): ColorValue {  return useCSSVariable(variable) as string as ColorValue;}