Skip to content

Skip grid end prefixes when the start is missing - #1572

Merged
ai merged 1 commit into
postcss:mainfrom
wozhenbang2004:fix-grid-end-missing-start-1064
Nov 22, 2026
Merged

ai merged 1 commit into
postcss:mainfrom
wozhenbang2004:fix-grid-end-missing-start-1064

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

Refs #1064.

Reproduced with Autoprefixer 10.7.0 and PostCSS 8.5.33, using grid: true and overrideBrowserslist: ['IE 10']:

/* Input */
.item { grid-column-end: 3; }

/* Current output */
.item { -ms-grid-column-span: 3; grid-column-end: 3; }

/* With this change */
.item { grid-column-end: 3; }

An end line is not a span length. Without a start, Autoprefixer already warns that it cannot prefix the declaration, but then still emits the original number as a span. Return after that warning for both row and column ends. The original declaration and warning are preserved.

The reported span start case in #1064 is already skipped by the current code; this addresses the remaining missing-start path. The regression checks both axes and corrects the existing grid fixture's extra span.

Verified through the public PostCSS API before and after the fix, including numeric start/end pairs, explicit end spans, the grid-area/span combination from #1159, and disabled/non-IE controls. All test:* scripts passed sequentially on Node.js 24.22.3: 289 tests, 100% line coverage, lint with one thread, and 63.94 kB against the 70 kB limit.

Return after warning about a missing grid start instead of treating an end line as a span length.
Cover row and column ends and update the existing grid fixture.
@ai
ai merged commit 12322da into postcss:main Nov 22, 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.

2 participants