Skip to content

Commit e0db036

Browse files
authored
Merge branch 'main' into main
2 parents 32d77b6 + c32b608 commit e0db036

File tree

5 files changed

+46
-13
lines changed

5 files changed

+46
-13
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- Added new `bg-{top,bottom}-{left,right}` utilities ([#17378](https://github.com/tailwindlabs/tailwindcss/pull/17378))
2626
- Added new `bg-{position,size}-*` utilities for arbitrary values ([#17432](https://github.com/tailwindlabs/tailwindcss/pull/17432))
2727
- Added new `shadow-*/{alpha}`, `inset-shadow-*/{alpha}`, and `text-shadow-*/{alpha}` utilities to control shadow opacity ([#17398](https://github.com/tailwindlabs/tailwindcss/pull/17398))
28+
- Added new `object-{top,bottom}-{left,right}` utilities ([#17437](https://github.com/tailwindlabs/tailwindcss/pull/17437))
2829

2930
### Fixed
3031

packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -7982,19 +7982,19 @@ exports[`getClassList 1`] = `
79827982
"not-italic",
79837983
"not-sr-only",
79847984
"object-bottom",
7985+
"object-bottom-left",
7986+
"object-bottom-right",
79857987
"object-center",
79867988
"object-contain",
79877989
"object-cover",
79887990
"object-fill",
79897991
"object-left",
7990-
"object-left-bottom",
7991-
"object-left-top",
79927992
"object-none",
79937993
"object-right",
7994-
"object-right-bottom",
7995-
"object-right-top",
79967994
"object-scale-down",
79977995
"object-top",
7996+
"object-top-left",
7997+
"object-top-right",
79987998
"oldstyle-nums",
79997999
"opacity-0",
80008000
"opacity-5",

packages/tailwindcss/src/compat/legacy-utilities.ts

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ export function registerLegacyUtilities(designSystem: DesignSystem) {
2929
decl('background-position', 'right bottom'),
3030
])
3131

32+
// Legacy `object-position` utilities for compatibility with v4.0 and earlier
33+
designSystem.utilities.static('object-left-top', () => [decl('object-position', 'left top')])
34+
designSystem.utilities.static('object-right-top', () => [decl('object-position', 'right top')])
35+
designSystem.utilities.static('object-left-bottom', () => [
36+
decl('object-position', 'left bottom'),
37+
])
38+
designSystem.utilities.static('object-right-bottom', () => [
39+
decl('object-position', 'right bottom'),
40+
])
41+
3242
designSystem.utilities.functional('max-w-screen', (candidate) => {
3343
if (!candidate.value) return
3444
if (candidate.value.kind === 'arbitrary') return

packages/tailwindcss/src/utilities.test.ts

+25-3
Original file line numberDiff line numberDiff line change
@@ -17743,15 +17743,21 @@ test('object', async () => {
1774317743

1774417744
// object-position
1774517745
'object-[var(--value)]',
17746+
'object-top',
17747+
'object-top-left',
17748+
'object-top-right',
1774617749
'object-bottom',
17747-
'object-center',
17750+
'object-bottom-left',
17751+
'object-bottom-right',
1774817752
'object-left',
17753+
'object-right',
17754+
'object-center',
17755+
17756+
// Legacy versions in v4.0 and earlier
1774917757
'object-left-bottom',
1775017758
'object-left-top',
17751-
'object-right',
1775217759
'object-right-bottom',
1775317760
'object-right-top',
17754-
'object-top',
1775517761
]),
1775617762
).toMatchInlineSnapshot(`
1775717763
".object-contain {
@@ -17782,6 +17788,14 @@ test('object', async () => {
1778217788
object-position: bottom;
1778317789
}
1778417790

17791+
.object-bottom-left {
17792+
object-position: left bottom;
17793+
}
17794+
17795+
.object-bottom-right {
17796+
object-position: right bottom;
17797+
}
17798+
1778517799
.object-center {
1778617800
object-position: center;
1778717801
}
@@ -17812,6 +17826,14 @@ test('object', async () => {
1781217826

1781317827
.object-top {
1781417828
object-position: top;
17829+
}
17830+
17831+
.object-top-left {
17832+
object-position: left top;
17833+
}
17834+
17835+
.object-top-right {
17836+
object-position: right top;
1781517837
}"
1781617838
`)
1781717839
expect(

packages/tailwindcss/src/utilities.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -3639,15 +3639,15 @@ export function createUtilities(theme: Theme) {
36393639
staticUtility('object-none', [['object-fit', 'none']])
36403640
staticUtility('object-scale-down', [['object-fit', 'scale-down']])
36413641

3642+
staticUtility('object-top', [['object-position', 'top']])
3643+
staticUtility('object-top-left', [['object-position', 'left top']])
3644+
staticUtility('object-top-right', [['object-position', 'right top']])
36423645
staticUtility('object-bottom', [['object-position', 'bottom']])
3643-
staticUtility('object-center', [['object-position', 'center']])
3646+
staticUtility('object-bottom-left', [['object-position', 'left bottom']])
3647+
staticUtility('object-bottom-right', [['object-position', 'right bottom']])
36443648
staticUtility('object-left', [['object-position', 'left']])
3645-
staticUtility('object-left-bottom', [['object-position', 'left bottom']])
3646-
staticUtility('object-left-top', [['object-position', 'left top']])
36473649
staticUtility('object-right', [['object-position', 'right']])
3648-
staticUtility('object-right-bottom', [['object-position', 'right bottom']])
3649-
staticUtility('object-right-top', [['object-position', 'right top']])
3650-
staticUtility('object-top', [['object-position', 'top']])
3650+
staticUtility('object-center', [['object-position', 'center']])
36513651
functionalUtility('object', {
36523652
themeKeys: ['--object-position'],
36533653
handle: (value) => [decl('object-position', value)],

0 commit comments

Comments
 (0)