Skip to content

Commit aa9a310

Browse files
authored
Add scrollbar-width and scrollbar-color to property order list (#20019)
This PR adds the `scrollbar-width` and `scrollbar-color` properties to the property order list such that we have a stable sort order for these properties. I put `scrollbar-width` before `scrollbar-color`, which is the same order as the `border-width` and `border-color` properties. ## Test plan 1. Had to update a test because of the swapped order 2. All other tests pass
1 parent 892af9d commit aa9a310

4 files changed

Lines changed: 15 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

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

packages/tailwindcss/src/compat/config.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ test('Config files can affect the theme', async () => {
215215

216216
expect(pretty(compiler.build(['bg-primary', 'scrollbar-primary']))).toMatchInlineSnapshot(`
217217
"
218-
.bg-primary {
219-
background-color: #c0ffee;
220-
}
221218
.scrollbar-primary {
222219
scrollbar-color: #c0ffee;
223220
}
221+
.bg-primary {
222+
background-color: #c0ffee;
223+
}
224224
"
225225
`)
226226
})

packages/tailwindcss/src/compat/plugin-api.test.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3953,17 +3953,17 @@ describe('matchUtilities()', () => {
39533953
expect(optimizeCss(await run(['scrollbar-[2px]', 'scrollbar-[#08c]', 'scrollbar-[#08c]/50'])))
39543954
.toMatchInlineSnapshot(`
39553955
"
3956+
.scrollbar-\\[2px\\] {
3957+
scrollbar-width: 2px;
3958+
}
3959+
39563960
.scrollbar-\\[\\#08c\\] {
39573961
scrollbar-color: #08c;
39583962
}
39593963
39603964
.scrollbar-\\[\\#08c\\]\\/50 {
39613965
scrollbar-color: oklab(59.9824% -.067 -.124 / .5);
39623966
}
3963-
3964-
.scrollbar-\\[2px\\] {
3965-
scrollbar-width: 2px;
3966-
}
39673967
"
39683968
`)
39693969
expect(optimizeCss(await run(['scrollbar-[2px]/50']))).toEqual('')
@@ -4117,10 +4117,14 @@ describe('matchUtilities()', () => {
41174117
),
41184118
).toMatchInlineSnapshot(`
41194119
"
4120-
.scrollbar-2 {
4120+
.scrollbar-2, .scrollbar-\\[2px\\] {
41214121
scrollbar-width: 2px;
41224122
}
41234123
4124+
.scrollbar-\\[length\\:var\\(--my-width\\)\\] {
4125+
scrollbar-width: var(--my-width);
4126+
}
4127+
41244128
.scrollbar-\\[\\#fff\\] {
41254129
scrollbar-color: #fff;
41264130
}
@@ -4129,10 +4133,6 @@ describe('matchUtilities()', () => {
41294133
scrollbar-color: oklab(100% 0 5.96046e-8 / .5);
41304134
}
41314135
4132-
.scrollbar-\\[2px\\] {
4133-
scrollbar-width: 2px;
4134-
}
4135-
41364136
.scrollbar-\\[color\\:var\\(--my-color\\)\\], .scrollbar-\\[color\\:var\\(--my-color\\)\\]\\/50 {
41374137
scrollbar-color: var(--my-color);
41384138
}
@@ -4143,10 +4143,6 @@ describe('matchUtilities()', () => {
41434143
}
41444144
}
41454145
4146-
.scrollbar-\\[length\\:var\\(--my-width\\)\\] {
4147-
scrollbar-width: var(--my-width);
4148-
}
4149-
41504146
.scrollbar-\\[var\\(--my-color\\)\\], .scrollbar-\\[var\\(--my-color\\)\\]\\/50 {
41514147
scrollbar-color: var(--my-color);
41524148
}

packages/tailwindcss/src/property-order.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ export default [
131131
'scroll-padding-bottom',
132132
'scroll-padding-left',
133133

134+
'scrollbar-width',
135+
'scrollbar-color',
134136
'scrollbar-gutter',
135137

136138
'list-style-position',

0 commit comments

Comments
 (0)