Ensure drop-shadow-* utilities work with theme values containing multiple shadows#20337
Ensure drop-shadow-* utilities work with theme values containing multiple shadows#20337UditDewan wants to merge 1 commit into
drop-shadow-* utilities work with theme values containing multiple shadows#20337Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughUpdated drop-shadow utility resolution to detect comma-separated theme values and use the raw value when generating CSS. Extended utility coverage with a 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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. Comment |
Confidence Score: 4/5Safe to merge; the change is small and targeted, and the existing test suite confirms the fix produces valid CSS without breaking any single-shadow or inline multi-shadow paths. The fix correctly replaces the broken The alpha-modifier branch in Reviews (1): Last reviewed commit: "Ensure drop-shadow utilities work with t..." | Re-trigger Greptile |
|
Hey! Thanks for the PR, but this would introduce a breaking change. The moment multiple shadows are being used in the value, the variable gets removed and inlined. That means that changes to the variable won't work since there is no variable anymore. I would recommend the workaround of explicitly using |
Fixes #17677
Summary
Theme values for
drop-shadow-*that contain multiple shadows currently produce broken CSS unless the user remembers to declare them with@theme inline. Given:drop-shadow-multigenerates:which is invalid because the comma-separated list ends up inside a single
drop-shadow(…)function — each shadow needs its owndrop-shadow(…)wrapper (the sibling--tw-drop-shadow-sizedeclaration already does this correctly).This PR implements the approach suggested in the issue discussion: when a
--drop-shadow-*theme value contains multiple shadows, treat it as if it were declared with@theme inline, since a singlevar(…)reference can never represent it correctly. The output for the theme value above becomes:Single-shadow theme values are unaffected and keep referencing the variable, so overriding them via the cascade continues to work.
Test plan
--drop-shadow-double) to the existingfiltertest inutilities.test.ts. It now compiles to the same (valid) output as the@theme inlinevariant — previously it produced the broken single-drop-shadow(…)output described above.pnpm vitest run --project tailwindcss— all 4871 tests pass.