jaredh159 / tailwind-react-native-classnames

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

fr: add support for the `web:` prefix. #301

Closed achtan closed 4 months ago

achtan commented 5 months ago

Hi, we are using this lib in our monorepo from which we are building rn native apps but also web pages.

for example when we use the class self-center we see warnings that this class is not supported in native. We could fix this with web:self-center .

jaredh159 commented 5 months ago

hi, thanks for opening the issue. is the thought here that web: would just turn the utility into a no-op with no warning on the native platform?

achtan commented 5 months ago

Yes, exactly!

aretrace commented 5 months ago

A web: prefix would be a great addition for expo/RNW projects.

jaredh159 commented 5 months ago

yeah, agreed, if anyone wants to PR this, that would be welcome, otherwise I should be able to get to it within a few weeks 👍

jaredh159 commented 5 months ago

hey there, i went to work on support for this today, and ... I'm pretty sure it already works. see https://github.com/jaredh159/tailwind-react-native-classnames/pull/293/commits/3bcfce31417033215200bc5efc4014af2db997e3

did you actually try something like web:self-center or web:not-valid-nope? it should not warn you

(on another note: self-center is a supported RN native utility as well, you shouldn't have gotten warnings about it)

jaredh159 commented 4 months ago

ok, well reopen if i'm missing something, but i'm pretty sure this already works, so closing 👍

kale5195 commented 3 months ago

@jaredh159 doesn't work for web:hover:bg-red-500 ?

jaredh159 commented 3 months ago

@jaredh159 doesn't work for web:hover:bg-red-500 ?

:hover is not a supported modifier in this library, that's a web only thing.