Skip to content

divide-* from v4 no longer handles the case where the last child is not visually the last due to ordering #18266

Answered by wongjn
rozsazoltan asked this question in Help
Discussion options

You must be logged in to vote

This is a side-effect of a breaking change. The docs talk about Space-between but this does apply the same to divide-* too:

Space-between selector

We've changed the selector used by the space-x-* and space-y-* utilities to address serious performance issues on large pages:

/* Before */
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem;
}
/* Now */
.space-y-4 > :not(:last-child) {
  margin-bottom: 1rem;
}

As of note, an inverse situation happens symmetrically in v3: https://play.tailwindcss.com/gBQdsDxkib

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rozsazoltan
Comment options

Answer selected by rozsazoltan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #18265 on June 09, 2025 19:14.