feat: add CSS @property rule support#284
Open
YevheniiKotyrlo wants to merge 2 commits intonativewind:mainfrom
Open
feat: add CSS @property rule support#284YevheniiKotyrlo wants to merge 2 commits intonativewind:mainfrom
YevheniiKotyrlo wants to merge 2 commits intonativewind:mainfrom
Conversation
49bbca6 to
aad4e3a
Compare
aad4e3a to
bfebfe5
Compare
bfebfe5 to
d83cc3e
Compare
Member
|
@YevheniiKotyrlo mind rebasing this with |
d83cc3e to
64a2be8
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tailwind CSS v4 shadow and ring utilities don't work on React Native. Two root causes:
@propertydefaults — Tailwind v4 uses ~53@propertydeclarations to register custom property initial values (e.g.,--tw-shadow,--tw-ring-shadow). Without parsing these, ring utilities produceboxShadow: []. (Fixed here)Stacking
This branch is based on #277 (2 commits total). Please review and merge #277 first — once it lands, this PR's diff will auto-reduce to just the
@propertychanges. Until then, the diff includes both PRs.Individual commits:
7aefcac— feat: add inset shadow parsing support #277: inset shadow parsing (view)64a2be8— this PR: @Property supportWhat this replaces
Previously, react-native-css faked
-moz-orientsupport to trigger Tailwind's@supportsfallback path. This fallback injected universal variable defaults which interfered with class-level overrides. The@propertyapproach is generic and framework-agnostic — this is the direction suggested during the #277 review.Changes (this PR only)
src/compiler/compiler.tsParse
@propertyrules, extractinitial-valueinto root variables viaextractPropertyRule/parsePropertyInitialValue. Handles length, number, percentage, color, angle, token-list, custom-ident, and repeated component types.src/compiler/stylesheet.tsAdd
addRootVariable()public method following the existing variable storage pattern.src/compiler/supports.tsRemove the
-moz-orienthack (no longer needed).src/native/styles/shorthands/_handler.tsAllow
StyleFunctionvalues (calc, var) to pass type checks in the shorthand handler. These are unresolved at pattern-match time but resolve to the correct type at runtime.src/native/styles/shorthands/box-shadow.tsFix color type from
"string"to"color"to accept platform color objects (e.g.,PlatformColorfromcurrentcolorresolution).Tests
@propertyparsing