Skip to content

[v4] space-y-* and labels have a different behavior compared to v3 (no upgrade information) #16395

Closed
tailwindlabs/tailwindcss.com
#2079
@maiconcarraro

Description

@maiconcarraro

What version of Tailwind CSS are you using?

v4.0.5

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

https://play.tailwindcss.com/mgLjLdT2cN

Image

Image

Describe your issue

Previously in v3, and specially when using shadcn/ui components, most of the organization are using space-y-* for the parent div of label + input, the space-y-* does work correctly if you combine with flex flex-col, or if you force label to be a block instead of inline. Found no information related to this in the upgrade guide.

If thats expected, I would also expect to the codemod to apply changes related to this or have some notes in the upgrade guide.

The change is related to previously using the sibling combinator which would skip the first element and apply to all including last, and the new space apply to all (including first) but last.

Found this comment: #15162 (comment)
And the issue on shadcn/ui: shadcn-ui/ui#6121 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions