Skip to content

Conversation

@alexanderalgemi
Copy link

@alexanderalgemi alexanderalgemi commented Nov 17, 2025

This fixes #8382

This PR fixes a bug in items that should function as a link. The on hover state was not working properly:

<Item variant="outline" role="listitem" asChild>
  <Link href={href}>
    <ItemContent>
      {/* ... */}
    </ItemContent>
  </Link>
</Item>

Shadcn uses the [a]:hover:bg-accent/50 class to target the anchor tag. This doesn't work, but [&:is(a):hover]:bg-accent/50 does.

Affected component/components
Item

How to reproduce:

<Item variant="outline" role="listitem" asChild>
  <Link href={href}>
    <ItemContent>
      {/* ... */}
    </ItemContent>
  </Link>
</Item>

@vercel
Copy link

vercel bot commented Nov 17, 2025

@alexanderalgemi is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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.

[bug]: <Item> generates a [a]:hover:bg-accent/50 class, which doesn't work

1 participant