jaredh159 / tailwind-react-native-classnames

simple, expressive API for tailwindcss + react-native
2.08k stars 84 forks source link

Question - How to override utilities in runtime #214

Closed liaoliao666 closed 1 year ago

liaoliao666 commented 1 year ago

My goal is to change the font size at runtime as follows

tw.setUtilities("text-content", 'text-[17px]')
jaredh159 commented 1 year ago

There's no current way to do something like this. Although there's nothing stopping you from providing runtime arbitrary values, like:

<View style={tw`text-[${someVar}]`} />

Would that satisfy your use case?