Tailwind CSS v4 provides drop-shadow-* utilities (drop-shadow-xs, drop-shadow-sm, drop-shadow-md, drop-shadow-lg, drop-shadow-xl, drop-shadow-2xl, drop-shadow-none, and arbitrary drop-shadow-[...]) that apply CSS filter: drop-shadow(...).
Currently in Uniwind, drop-shadow is explicitly ignored in packages/uniwind/src/bundler/css-processor/functions.ts by returning undefined.
Motivation
Uniwind already supports other CSS filter functions (blur, brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, sepia) as compiled filter strings.
With modern React Native (0.81+):
- The
filter style prop supports CSS filter strings including drop-shadow(offsetX offsetY blurRadius color) (available on Android API 31+ and iOS via SwiftUI-based filters).
- Web runtime passes standard CSS filter strings directly.
Adding support for drop-shadow will complete the filter feature set and provide full parity with Tailwind CSS v4 filter utilities.
Proposed Solution
-
Update CSS Processor (functions.ts):
- Parse
drop-shadow function arguments (x-offset, y-offset, blur-radius, and color) into a valid CSS filter string: drop-shadow(<offsetX> <offsetY> <blurRadius> <color>).
- Support multi-drop-shadow values (e.g.
drop-shadow-md which chains multiple drop-shadow(...) calls).
- Support arbitrary drop-shadow values (e.g.
drop-shadow-[0_10px_8px_rgba(0,0,0,0.5)]).
-
Add Unit Tests (filters.test.tsx):
- Add test cases in
packages/uniwind/tests/native/styles-parsing/filters.test.tsx verifying:
- Preset utilities:
drop-shadow-sm, drop-shadow-md, drop-shadow-lg, drop-shadow-2xl, drop-shadow-none.
- Arbitrary values:
drop-shadow-[...].
- Combination with other filters: e.g.
blur-md drop-shadow-md.
Contribution
I am happy to submit a PR with this implementation and accompanying test cases.
Tailwind CSS v4 provides
drop-shadow-*utilities (drop-shadow-xs,drop-shadow-sm,drop-shadow-md,drop-shadow-lg,drop-shadow-xl,drop-shadow-2xl,drop-shadow-none, and arbitrarydrop-shadow-[...]) that apply CSSfilter: drop-shadow(...).Currently in Uniwind,
drop-shadowis explicitly ignored inpackages/uniwind/src/bundler/css-processor/functions.tsby returningundefined.Motivation
Uniwind already supports other CSS filter functions (
blur,brightness,contrast,grayscale,hue-rotate,invert,opacity,saturate,sepia) as compiled filter strings.With modern React Native (0.81+):
filterstyle prop supports CSS filter strings includingdrop-shadow(offsetX offsetY blurRadius color)(available on Android API 31+ and iOS via SwiftUI-based filters).Adding support for
drop-shadowwill complete the filter feature set and provide full parity with Tailwind CSS v4 filter utilities.Proposed Solution
Update CSS Processor (
functions.ts):drop-shadowfunction arguments (x-offset, y-offset, blur-radius, and color) into a valid CSS filter string:drop-shadow(<offsetX> <offsetY> <blurRadius> <color>).drop-shadow-mdwhich chains multipledrop-shadow(...)calls).drop-shadow-[0_10px_8px_rgba(0,0,0,0.5)]).Add Unit Tests (
filters.test.tsx):packages/uniwind/tests/native/styles-parsing/filters.test.tsxverifying:drop-shadow-sm,drop-shadow-md,drop-shadow-lg,drop-shadow-2xl,drop-shadow-none.drop-shadow-[...].blur-md drop-shadow-md.Contribution
I am happy to submit a PR with this implementation and accompanying test cases.