Skip to content

Fix flex-flow wrap-reverse in the 2009 box-orient and box-direction fallback - #1578

Merged
ai merged 1 commit into
postcss:mainfrom
goranai:fix/flex-flow-wrap-reverse
Nov 27, 2026
Merged

ai merged 1 commit into
postcss:mainfrom
goranai:fix/flex-flow-wrap-reverse

Conversation

@goranai

@goranai goranai commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #1577.

Fixes the filter in lib/hacks/flex-flow.js that is meant to drop wrap, nowrap and wrap-reverse before the 2009 box-orient and box-direction fallback is built. The last operand was the bare string 'wrap-reverse', which is always truthy, so wrap-reverse was kept and read as a vertical, reversed direction.

Before, for safari 6:

a { flex-flow: wrap-reverse }          -> -webkit-box-orient: vertical; -webkit-box-direction: reverse
a { flex-flow: wrap-reverse column }   -> -webkit-box-orient: vertical; -webkit-box-direction: reverse

After: the first gets no 2009 declarations (like flex-flow: wrap), the second gets vertical and normal.

Behavior change: only output for flex-flow values that contain wrap-reverse, and only for browsers that use the 2009 spec. Other values give the same output as before.

Tests: added .j and .k to test/cases/flexbox.css and .out.css. With the old lib/hacks/flex-flow.js the suite shows 287 of 289 passing (the flexbox case fails in 2 tests). With the fix, all 289 pass. oxlint and oxfmt --check are clean on the changed files. I also compared main and the fix on 399 combinations of 1 to 3 direction and wrap keywords, each with single space, double space and tab separators (1197 runs), against a small oracle: main was wrong on 192, the fix on 0, and no input that was right on main changed output.

I did not edit CHANGELOG.md.

Validated with Claude Opus 5.5.

@ai
ai merged commit 7d9f573 into postcss:main Nov 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flex-flow: wrap-reverse gets a vertical, reversed 2009 box fallback

2 participants