Skip to content

feat: support drop-shadow filter function - #645

Open
feri-irawan wants to merge 1 commit into
uni-stack:mainfrom
feri-irawan:feat/drop-shadow-filter
Open

feat: support drop-shadow filter function#645
feri-irawan wants to merge 1 commit into
uni-stack:mainfrom
feri-irawan:feat/drop-shadow-filter

Conversation

@feri-irawan

@feri-irawanferi-irawan commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Add support for drop-shadow filter utilities in React Native. Previously, the drop-shadow function in the CSS processor returned undefined, causing all drop-shadow-* classes to be silently ignored on native.

This PR adds a processDropShadow handler that compiles Tailwind CSS v4's drop-shadow() filter function into React Native compatible filter strings.

Discussion: #644

Changes

packages/uniwind/src/bundler/css-processor/functions.ts

  • Route drop-shadow function calls to the new processDropShadow method instead of returning undefined.
  • Add processDropShadow private method that:
    • Filters out white-space tokens from the LightningCSS AST to prevent double-spacing.
    • Maps each argument through processValue and wraps appropriately for JS template expression.
    • Produces output like "drop-shadow(" + (0) + " " + (3) + " " + (3) + " " + "#0000001f" + ")".

packages/uniwind/tests/native/styles-parsing/filters.test.tsx

  • Add comprehensive Drop shadow test block with 9 assertions covering:
    • All preset sizes (drop-shadow-sm, drop-shadow-md, drop-shadow-lg, drop-shadow-xl, drop-shadow-2xl)
    • drop-shadow-none
    • Arbitrary values (drop-shadow-[0_10px_8px_rgba(0,0,0,0.5)])
    • Combined filters (drop-shadow-md blur-md)
    • Color modifiers (drop-shadow-md drop-shadow-red-500)

Supported Utilities

ClassOutput
drop-shadow-smdrop-shadow(0 1 2 #00000026)
drop-shadow-mddrop-shadow(0 3 3 #0000001f)
drop-shadow-lgdrop-shadow(0 4 4 #00000026)
drop-shadow-xldrop-shadow(0 9 7 #0000001a)
drop-shadow-2xldrop-shadow(0 25 25 #00000026)
drop-shadow-none(empty — no filter)
drop-shadow-[0_10px_8px_rgba(0,0,0,0.5)]drop-shadow(0 10 8 #00000080)
blur-md drop-shadow-mdblur(12px) drop-shadow(0 3 3 #0000001f)
drop-shadow-md drop-shadow-red-500drop-shadow(0 3 3 #fb2c36ff)

Verification

All CI-equivalent checks pass locally:

  • bun run build
  • bun run check:typescript
  • bun run check:typescript:test
  • bun run lint
  • bun run check:format
  • bun run circular:check
  • bun run test:native (147 tests passed)
  • bun run test:web (26 tests passed)
  • bun run test:types
  • bun run test:e2e (9 tests passed)

Summary by CodeRabbit

  • Bug Fixes

    • Fixed drop-shadow styles so they render correctly in React Native.
    • Preserved spacing, quoted values, custom shadow definitions, and color combinations.
    • Ensured drop-shadow utilities work alongside blur filters and support the “none” option.
  • Tests

    • Added coverage for standard shadow sizes, custom values, blur combinations, colored shadows, and disabled shadows.

Add processDropShadow handler to compile Tailwind CSS v4 drop-shadow
filter utilities (drop-shadow-sm, drop-shadow-md, etc.) into React
Native compatible filter strings.
Supports preset sizes, arbitrary values, color modifiers, and
combined filters.
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9556f330-e608-47c5-8a1f-0ea09f5fc4f1

📥 Commits

Reviewing files that changed from the base of the PR and between 0f8bdcd and f48972c.

📒 Files selected for processing (2)
  • packages/uniwind/src/bundler/css-processor/functions.ts
  • packages/uniwind/tests/native/styles-parsing/filters.test.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The CSS processor now converts drop-shadow functions into React Native filter expressions. Native filter tests cover named sizes, arbitrary values, disabled shadows, combined filters, and colored shadows.

Changes

Drop-shadow processing

Layer / File(s)Summary
Drop-shadow runtime processing and validation
packages/uniwind/src/bundler/css-processor/functions.ts, packages/uniwind/tests/native/styles-parsing/filters.test.tsx
drop-shadow arguments are processed, grouped, and joined into reconstructed filter expressions. Tests cover named sizes, arbitrary values, none, blur combinations, and colored shadows.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk:⚪ Minimal · up to f4897

This adds native support for drop-shadow filter utilities with coverage for preset, arbitrary, combined, and color-modified values; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers:jpudysz, brentlok

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the primary change: adding support for the drop-shadow filter function.
Docstring Coverage✅ PassedDocstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

Copy link
Copy Markdown

Greptile Summary

Adds native compilation support for Tailwind CSS drop-shadow() filters.

  • Routes drop-shadow functions through a dedicated processor that removes whitespace tokens and constructs the React Native filter string.
  • Adds native parsing coverage for presets, arbitrary values, composition, disabling, and color modifiers.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or non-blocking issues identified.

The new processor preserves the tested drop-shadow arguments, composes correctly with other filters, and has coverage for the principal preset, arbitrary-value, disabled, and color-modified paths.

Important Files Changed

FilenameOverview
packages/uniwind/src/bundler/css-processor/functions.tsAdds drop-shadow argument processing and generated filter-expression construction; no actionable defect was established.
packages/uniwind/tests/native/styles-parsing/filters.test.tsxAdds broad native drop-shadow parsing assertions for supported utility forms.

Reviews (1): Last reviewed commit: "feat: support drop-shadow filter functio..." | Re-trigger Greptile

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@feri-irawan