gluestack

gluestack Logogluestack

Use Tailwind color values in JS?

frubalu1865 posted this in #support
Open in Discord
Avatar
frubalu1865OP
I know V1 had a useToken hook that seemed helpful, and of course Tailwind itself has the option to use the actual values using their resolveConfig helper like this:
import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfig from '../tailwind.config';

const { theme } = resolveConfig(tailwindConfig);

export default theme;

The above block of code however has issues with Gluestack's tokens: rgb(var(--color-primary-500/<alpha-value>)" is not a valid color or brush. Is the useToken hook going to make a reappearance in v2, or is there another way to access these values in JS/TS?

1 Reply