Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*:has(...) > & targeting is not working as expected #605

Open
PrettyCoffee opened this issue Dec 16, 2024 · 2 comments
Open

*:has(...) > & targeting is not working as expected #605

PrettyCoffee opened this issue Dec 16, 2024 · 2 comments

Comments

@PrettyCoffee
Copy link

Hey!

I think I found a bug when targeting the current class with an :has selector on a parent. It will unexpectedly prepend the selector with the class, but probably should not.

For example:

// css call:
const myClass = css`
  *:has(:focus-visible) > & {
    /* styles */
  }
`

// resulting selector
.go3480710288 :has(:focus-visible) > .go3480710288

// selector that I would actually expect:
:has(:focus-visible) > .go3480710288

I also just found out that this bug appears as well when using other similar selectors, like :not(...) and :where(...).

When targeting from a parent with :hover, it would behave like expected, e.g.:

// css call:
const myClass = css`
  *:hover > & {
    /* styles */
  }
`

// resulting selector
:hover > .go3480710288
@1337MARCEL
Copy link

I noticed the same issue in our project when we updated goober from v2.1.14 => v2.1.16

@cristianbote
Copy link
Owner

heya! thanks for the bug report. Let me look into 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

No branches or pull requests

3 participants