Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- _Experimental_: add `@container-size` utility ([#18901](https://github.com/tailwindlabs/tailwindcss/pull/18901))
- _Experimental_: 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))
- _Experimental_: 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), [#20019](https://github.com/tailwindlabs/tailwindcss/pull/20019))
- Allow using `@variant` with stacked variants (e.g. `@variant hover:focus { … }`) ([#19996](https://github.com/tailwindlabs/tailwindcss/pull/19996))
- Allow using `@variant` with compound variants (e.g. `@variant hover, focus { … }`) ([#19996](https://github.com/tailwindlabs/tailwindcss/pull/19996))
- Support `--default(…)` in `--value(…)` and `--modifier(…)` for functional `@utility` definitions ([#19989](https://github.com/tailwindlabs/tailwindcss/pull/19989))
- Add `scrollbar-gutter-*` utilities ([#20018](https://github.com/tailwindlabs/tailwindcss/pull/20018))

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11014,6 +11014,9 @@ exports[`getClassList 1`] = `
"scroll-py-px",
"scroll-smooth",
"scrollbar-auto",
"scrollbar-gutter-auto",
"scrollbar-gutter-both",
"scrollbar-gutter-stable",
"scrollbar-none",
"scrollbar-thin",
"scrollbar-thumb-current",
Expand Down
6 changes: 3 additions & 3 deletions packages/tailwindcss/src/compat/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ test('Config files can affect the theme', async () => {

expect(pretty(compiler.build(['bg-primary', 'scrollbar-primary']))).toMatchInlineSnapshot(`
"
.bg-primary {
background-color: #c0ffee;
}
.scrollbar-primary {
scrollbar-color: #c0ffee;
}
.bg-primary {
background-color: #c0ffee;
}
"
`)
})
Expand Down
22 changes: 9 additions & 13 deletions packages/tailwindcss/src/compat/plugin-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3953,17 +3953,17 @@ describe('matchUtilities()', () => {
expect(optimizeCss(await run(['scrollbar-[2px]', 'scrollbar-[#08c]', 'scrollbar-[#08c]/50'])))
.toMatchInlineSnapshot(`
"
.scrollbar-\\[2px\\] {
scrollbar-width: 2px;
}

.scrollbar-\\[\\#08c\\] {
scrollbar-color: #08c;
}

.scrollbar-\\[\\#08c\\]\\/50 {
scrollbar-color: oklab(59.9824% -.067 -.124 / .5);
}

.scrollbar-\\[2px\\] {
scrollbar-width: 2px;
}
"
`)
expect(optimizeCss(await run(['scrollbar-[2px]/50']))).toEqual('')
Expand Down Expand Up @@ -4117,10 +4117,14 @@ describe('matchUtilities()', () => {
),
).toMatchInlineSnapshot(`
"
.scrollbar-2 {
.scrollbar-2, .scrollbar-\\[2px\\] {
scrollbar-width: 2px;
}

.scrollbar-\\[length\\:var\\(--my-width\\)\\] {
scrollbar-width: var(--my-width);
}

.scrollbar-\\[\\#fff\\] {
scrollbar-color: #fff;
}
Expand All @@ -4129,10 +4133,6 @@ describe('matchUtilities()', () => {
scrollbar-color: oklab(100% 0 5.96046e-8 / .5);
}

.scrollbar-\\[2px\\] {
scrollbar-width: 2px;
}

.scrollbar-\\[color\\:var\\(--my-color\\)\\], .scrollbar-\\[color\\:var\\(--my-color\\)\\]\\/50 {
scrollbar-color: var(--my-color);
}
Expand All @@ -4143,10 +4143,6 @@ describe('matchUtilities()', () => {
}
}

.scrollbar-\\[length\\:var\\(--my-width\\)\\] {
scrollbar-width: var(--my-width);
}

.scrollbar-\\[var\\(--my-color\\)\\], .scrollbar-\\[var\\(--my-color\\)\\]\\/50 {
scrollbar-color: var(--my-color);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/tailwindcss/src/property-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export default [
'scroll-padding-bottom',
'scroll-padding-left',

'scrollbar-width',
'scrollbar-color',
'scrollbar-gutter',

'list-style-position',
Comment thread
RobinMalfait marked this conversation as resolved.
'list-style-type',
'list-style-image',
Expand Down
30 changes: 30 additions & 0 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11439,6 +11439,36 @@ test('scrollbar-width', async () => {
).toEqual('')
})

test('scrollbar-gutter', async () => {
expect(await run(['scrollbar-gutter-auto', 'scrollbar-gutter-stable', 'scrollbar-gutter-both']))
.toMatchInlineSnapshot(`
"
.scrollbar-gutter-auto {
scrollbar-gutter: auto;
}

.scrollbar-gutter-both {
scrollbar-gutter: stable both-edges;
}

.scrollbar-gutter-stable {
scrollbar-gutter: stable;
}
"
`)
expect(
await run([
'scrollbar-gutter',
'-scrollbar-gutter-auto',
'-scrollbar-gutter-stable',
'-scrollbar-gutter-both',
'scrollbar-gutter-auto/foo',
'scrollbar-gutter-stable/foo',
'scrollbar-gutter-both/foo',
]),
).toEqual('')
})

test('scrollbar-thumb', async () => {
expect(
await compileCss(
Expand Down
4 changes: 4 additions & 0 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,10 @@ export function createUtilities(theme: Theme) {
staticUtility('scrollbar-thin', [['scrollbar-width', 'thin']])
staticUtility('scrollbar-none', [['scrollbar-width', 'none']])

staticUtility('scrollbar-gutter-auto', [['scrollbar-gutter', 'auto']])
staticUtility('scrollbar-gutter-stable', [['scrollbar-gutter', 'stable']])
staticUtility('scrollbar-gutter-both', [['scrollbar-gutter', 'stable both-edges']])

{
let scrollbarColorProperties = () => {
return atRoot([
Expand Down