Skip to content

Commit 82d486a

Browse files
authored
Fix order-first and order-last for Firefox (#16266)
This PR fixes an issue where `order-last` doesn't work as expected in Firefox. The implementation of `order-last`, looks like this: ```css .order-last { order: calc(infinity); } ``` Which is valid CSS, and `calc(infinity)` is even valid in Firefox. You can use this in other properties such as `border-radius`: ```css .rounded-full { border-radius: calc(infinity * 1px); } ``` While this works, in properties like `order` it just doesn't work. Fixes: #16165
1 parent 3b61277 commit 82d486a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Ensure that the `containers` JS theme key is added to the `--container-*` namespace ([#16169](https://github.com/tailwindlabs/tailwindcss/pull/16169))
1515
- Fix missing `@keyframes` definition ([#16237](https://github.com/tailwindlabs/tailwindcss/pull/16237))
1616
- Vite: Skip parsing stylesheets with the `?commonjs-proxy` flag ([#16238](https://github.com/tailwindlabs/tailwindcss/pull/16238))
17+
- Fix `order-first` and `order-last` for Firefox ([#16266](https://github.com/tailwindlabs/tailwindcss/pull/16266))
1718

1819
## [4.0.3] - 2025-02-01
1920

packages/tailwindcss/src/utilities.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,11 @@ test('order', async () => {
10531053
}
10541054
10551055
.order-first {
1056-
order: calc(-infinity);
1056+
order: -9999;
10571057
}
10581058
10591059
.order-last {
1060-
order: calc(infinity);
1060+
order: 9999;
10611061
}
10621062
10631063
.order-none {

packages/tailwindcss/src/utilities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ export function createUtilities(theme: Theme) {
576576
/**
577577
* @css `order`
578578
*/
579-
staticUtility('order-first', [['order', 'calc(-infinity)']])
580-
staticUtility('order-last', [['order', 'calc(infinity)']])
579+
staticUtility('order-first', [['order', '-9999']])
580+
staticUtility('order-last', [['order', '9999']])
581581
staticUtility('order-none', [['order', '0']])
582582
functionalUtility('order', {
583583
supportsNegative: true,

0 commit comments

Comments
 (0)