feat: Support drop-shadow filter utilities on native
#644
Closed
feri-irawan
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
Closing this discussion in favor of original issue - #643 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Add support for Tailwind CSS v4's
drop-shadowfilter utilities on React Native.Currently,
drop-shadow-*classes are silently ignored on native because thedrop-shadowfunction in the CSS processor returnsundefined. Since React Native already supportsfilter: "drop-shadow(...)"as a string value (similar to howblur,grayscale, and other filters are already handled in Uniwind), this seems like a natural addition.Context
Tailwind CSS v4 provides the following
drop-shadowutilities:drop-shadow-smfilter: drop-shadow(0 1px 2px var(--drop-shadow-color, ...))drop-shadow-mdfilter: drop-shadow(0 3px 3px var(--drop-shadow-color, ...))drop-shadow-lgfilter: drop-shadow(0 4px 4px var(--drop-shadow-color, ...))drop-shadow-xlfilter: drop-shadow(0 9px 7px var(--drop-shadow-color, ...))drop-shadow-2xlfilter: drop-shadow(0 25px 25px var(--drop-shadow-color, ...))drop-shadow-nonefilter: drop-shadow(0 0 0 transparent)These also support:
drop-shadow-[0_10px_8px_rgba(0,0,0,0.5)]drop-shadow-red-500,drop-shadow-indigo-500/50blur-md drop-shadow-mdReact Native (0.76+) supports
filteras a string prop, includingdrop-shadow(). Reference: React Native Shadow PropsProposed Implementation
The change is minimal — a new
processDropShadowmethod inpackages/uniwind/src/bundler/css-processor/functions.tsthat:white-spacetokens from the LightningCSS ASTprocessValueThis follows the exact same approach as
processFilterFunctionforblur,grayscale, etc.I have a working implementation
I've already implemented this with comprehensive tests covering all variants (presets, arbitrary values, color modifiers, combined filters). All CI checks pass locally:
bun run buildbun run check:typescript/check:typescript:testbun run lint/check:formatbun run circular:checkbun run test:native(147 tests) /test:web(26 tests) /test:typesbun run test:e2e(9 tests)Happy to open a PR if this sounds good to the maintainers. Looking forward to feedback!
Update: PR submitted at #645
All reactions