-
Notifications
You must be signed in to change notification settings - Fork 139
fix: expose missing NATIVEWIND_OS
in NativeWind plugin
#1173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 2a73b14 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @raghav-reglobe 👋 thanks for the PR!
left some comments 👇
**Commit message:** Set `process.env.NATIVEWIND_OS` based on `compiler.options.name` if it is "android" or "ios" in NativeWind plugin - Removes `presetPlatform` option and related logic. - Automatically sets `process.env.NATIVEWIND_OS` to "android" or "ios" if `compiler.options.name` matches. - Ensures consistent platform detection for NativeWind builds.
Removed unused commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good 👍
please add changeset entry by running pnpm changeset
in root of the monorepo
@raghav-reglobe please also run |
NATIVEWIND_OS
in NativeWind plugin.
NATIVEWIND_OS
in NativeWind plugin.NATIVEWIND_OS
in NativeWind plugin
@raghav-reglobe thank you for your contribution 🎉 |
Problem statement
nativewind/preset chooses web, when process.env.NATIVEWIND_OS !== "native" or is undefined.
The Re-Pack plug-in never sets that variable, so Tailwind’s web defaults win and the angle variables
(--tw-rotate, --tw-skew-x/y) are emitted as bare 0 → Android crashes.
Metro does set the var (via withNativeWind()), so the two bundlers behave differently.
Proposed fix
Force the platform passed to nativewind/preset.
Why this solves the root bug (no work-arounds)
--tw-rotate: 0deg; --tw-skew-x:0deg; --tw-skew-y:0deg
to the reset layer,so the generated CSS already has the correct units.
cssToReactNativeRuntime
output,and palette colours work unchanged.