add tab-* utilities#20022
Conversation
Confidence Score: 5/5Safe to merge — the change adds a new, self-contained utility with no modifications to existing logic. The implementation follows the exact same pattern used by every comparable functional utility in the file ( No files require special attention. Reviews (2): Last reviewed commit: "add `tab-*` utilities" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/tailwindcss/src/utilities.test.ts`:
- Around line 11850-11858: The invalid-candidate list passed to the test helper
run in utilities.test.ts is missing an explicit case for the zero value; add
'tab-0' to the array argument of the run([...]) call (the same array that
currently contains 'tab', '-tab-2', 'tab-2.5', 'tab-1/2', 'tab-unknown',
'tab-2/foo', 'tab-[12px]/foo') so the tests assert that a bare zero is invalid
and lock in the “positive integer bare value” rule.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: aae9d4ce-8ab9-46ff-a1a9-56693791eb61
⛔ Files ignored due to path filters (1)
packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
packages/tailwindcss/src/property-order.tspackages/tailwindcss/src/utilities.test.tspackages/tailwindcss/src/utilities.ts
| await run([ | ||
| 'tab', | ||
| '-tab-2', | ||
| 'tab-2.5', | ||
| 'tab-1/2', | ||
| 'tab-unknown', | ||
| 'tab-2/foo', | ||
| 'tab-[12px]/foo', | ||
| ]), |
There was a problem hiding this comment.
Add an explicit invalid assertion for tab-0.
On Line 11850 onward, the invalid-candidate list is missing tab-0, which helps lock in the “positive integer bare value” rule and prevent regressions.
Suggested test delta
expect(
await run([
'tab',
+ 'tab-0',
'-tab-2',
'tab-2.5',
'tab-1/2',
'tab-unknown',
'tab-2/foo',
'tab-[12px]/foo',
]),
).toEqual('')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await run([ | |
| 'tab', | |
| '-tab-2', | |
| 'tab-2.5', | |
| 'tab-1/2', | |
| 'tab-unknown', | |
| 'tab-2/foo', | |
| 'tab-[12px]/foo', | |
| ]), | |
| await run([ | |
| 'tab', | |
| 'tab-0', | |
| '-tab-2', | |
| 'tab-2.5', | |
| 'tab-1/2', | |
| 'tab-unknown', | |
| 'tab-2/foo', | |
| 'tab-[12px]/foo', | |
| ]), |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/tailwindcss/src/utilities.test.ts` around lines 11850 - 11858, The
invalid-candidate list passed to the test helper run in utilities.test.ts is
missing an explicit case for the zero value; add 'tab-0' to the array argument
of the run([...]) call (the same array that currently contains 'tab', '-tab-2',
'tab-2.5', 'tab-1/2', 'tab-unknown', 'tab-2/foo', 'tab-[12px]/foo') so the tests
assert that a bare zero is invalid and lock in the “positive integer bare value”
rule.
This PR adds new
tab-*utilities.The
tab-*utilities set thetab-sizeproperty. They support positive integer bare values, arbitrary values, and theme values coming from--tab-size-*:tab-2tab-size: 2;tab-[12px]tab-size: 12px;tab-githubtab-size: var(--tab-size-github);tab-github:This doesn't ship with any
--tab-size-*theme keys out of the box.This also adds
tab-sizeto the property order near the other text layout properties.Test plan
tab-*utility tests