Conversation
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe length-unit set now includes additional font-relative and viewport-relative units, so Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change recognizes the documented units as lengths and includes generated-CSS checks for them; no merge-blocking issue is evident. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 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 |
Summary
isLengthinpackages/tailwindcss/src/utils/infer-data-type.tschecks arbitrary values against a fixed list of units. That list was carried over from v3 and is missing several CSS length units: the small, large, and dynamic viewport unitssvi,svb,svmin,svmax,lvi,lvb,lvmin,lvmax,dvi,dvb,dvmin,dvmax, and the font-relative unitscap,ic,rex,rch,rcap,ric.Because these values are not detected as lengths, utilities that choose a property based on the value type fall back to the color branch. For example
text-[10dvmin]generatescolor: 10dvmininstead offont-size: 10dvmin(whiletext-[10dvw]already works), andborder-[1dvmin]generatesborder-color: 1dvmin. Today the only workaround is an explicit type hint liketext-[length:10dvmin].This adds the missing units, all of which are
<length>units defined in CSS Values and Units Level 4, to the list. Values that were already detected are unaffected.Test plan
packages/tailwindcss/src/utilities.test.tscovering one unit from each group (cap,rex,svi,dvmin). It fails without the change (the rules are emitted ascolor: 1<unit>) and passes with it.vitest run src/utilities.test.ts -t "viewport and font-relative"(inpackages/tailwindcss)vitest run(inpackages/tailwindcss): 42 files, 5016 tests passedprettier --checkon the changed files