Skip to content

group-visited doesn't work in Safari and mobile browsers #16537

Open
@Leoyang0717

Description

@Leoyang0717

What version of Tailwind CSS are you using?

v4.0.0

What browser are you using?

This bug appears on Safari and mobile but not in Chrome.

Chrome it's work

Image

Safari

Image

Chrome & Safari mobile

Image Image

Reproduction URL

https://play.tailwindcss.com/TTbwnIDE64

Describe your issue

When upgrading from v3.4.17 to v4.0.0, I encountered an issue on Safari and mobile devices where the visited state does not change the color as expected.

I suspect that :is or :where combined with :visited might not be compatible with Safari or mobile browsers or is it actually not recommended to use group-visited?

v4.0.0 compile result, doesn't work!
.group-visited\:text-red-600 {
  &:is(:where(.group):visited *) {
    color: var(--color-red-600) /* oklch(0.577 0.245 27.325) */;
  }
}

v3.4.17 compile result, work!
.group:visited .group-visited\:text-red-600 {
  color: rgb(220 38 38 ) /* #dc2626 */;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions