Add scrollbar-width and scrollbar-color utilities#19981
Add scrollbar-width and scrollbar-color utilities#19981adamwathan wants to merge 1 commit intomainfrom
Conversation
Adds new utilities for the `scrollbar-width` and `scrollbar-color` CSS properties: - `scrollbar-auto`, `scrollbar-thin`, `scrollbar-none` for `scrollbar-width` - `scrollbar-thumb-*` and `scrollbar-track-*` color utilities, which compose via the `--tw-scrollbar-thumb` / `--tw-scrollbar-track` CSS variables so the thumb and track colors can be set independently while emitting a single `scrollbar-color` declaration.
WalkthroughThis pull request adds new scrollbar-related Tailwind CSS utilities. It introduces three static utilities for 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
CHANGELOG.md (1)
13-13: Add PR reference link for changelog consistencyLine 13 is the only new Unreleased bullet without a PR link, which makes it harder to trace. Please append
([#19981](https://github.com/tailwindlabs/tailwindcss/pull/19981))like adjacent entries.📝 Suggested patch
-- Add `scrollbar-{auto,thin,none}` utilities for `scrollbar-width`, and `scrollbar-thumb-*` / `scrollbar-track-*` color utilities for `scrollbar-color` +- Add `scrollbar-{auto,thin,none}` utilities for `scrollbar-width`, and `scrollbar-thumb-*` / `scrollbar-track-*` color utilities for `scrollbar-color` ([`#19981`](https://github.com/tailwindlabs/tailwindcss/pull/19981))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CHANGELOG.md` at line 13, Update the Unreleased changelog entry that currently reads "Add `scrollbar-{auto,thin,none}` utilities for `scrollbar-width`, and `scrollbar-thumb-*` / `scrollbar-track-*` color utilities for `scrollbar-color`" by appending the PR reference "([`#19981`](https://github.com/tailwindlabs/tailwindcss/pull/19981))" so it matches adjacent entries; modify the exact bullet text in CHANGELOG.md to include that PR link.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@CHANGELOG.md`:
- Line 13: Update the Unreleased changelog entry that currently reads "Add
`scrollbar-{auto,thin,none}` utilities for `scrollbar-width`, and
`scrollbar-thumb-*` / `scrollbar-track-*` color utilities for `scrollbar-color`"
by appending the PR reference
"([`#19981`](https://github.com/tailwindlabs/tailwindcss/pull/19981))" so it
matches adjacent entries; modify the exact bullet text in CHANGELOG.md to
include that PR link.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 078ec857-0330-4db4-95c9-73f8edba1c5b
⛔ Files ignored due to path filters (1)
packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
CHANGELOG.mdpackages/tailwindcss/src/utilities.test.tspackages/tailwindcss/src/utilities.ts
Summary
Adds utilities for the
scrollbar-widthandscrollbar-colorCSS properties.scrollbar-widthThree static utilities mirroring the spec keywords:
scrollbar-autoscrollbar-width: auto;scrollbar-thinscrollbar-width: thin;scrollbar-nonescrollbar-width: none;scrollbar-colorThe
scrollbar-colorproperty takes two colors (thumb and track). To allow them to be set independently, two color utilities are added that share a pair of CSS variables (--tw-scrollbar-thumband--tw-scrollbar-track), following the same pattern as the gradient stop utilities (from-*/via-*/to-*):scrollbar-thumb-<color>--tw-scrollbar-thumb: <color>; scrollbar-color: var(--tw-scrollbar-thumb) var(--tw-scrollbar-track);scrollbar-track-<color>--tw-scrollbar-track: <color>; scrollbar-color: var(--tw-scrollbar-thumb) var(--tw-scrollbar-track);Both go through
colorUtility, so they automatically support the standard color palette, theme keys (--scrollbar-thumb-color/--scrollbar-track-colorwith--coloras a fallback), arbitrary values, and the/<alpha>opacity modifier. The variables are registered with@property(initial value#0000), matching the gradient-stop convention so an unset side falls back to transparent.Test plan
pnpm test(all 4480 tests pass)scrollbar-width,scrollbar-thumb, andscrollbar-tracktest cases inutilities.test.tscovering palette colors, theme-key colors,current/inherit/transparent, arbitrary colors,/<alpha>modifiers, and invalid candidatesintellisense.test.tssnapshot updated to include the new class namesGenerated by Claude Code