Skip to content

Ignore :has() selectors nested inside @supports rules #312

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

Closed
3 tasks done
romainmenke opened this issue Mar 18, 2022 · 0 comments · Fixed by #333
Closed
3 tasks done

Ignore :has() selectors nested inside @supports rules #312

romainmenke opened this issue Mar 18, 2022 · 0 comments · Fixed by #333

Comments

@romainmenke
Copy link
Member

Bug description

@supports can now also check for selector features.

:has() should not be transformed if the stylesheet author made the selector conditional.

Source CSS

@supports (selector(:has(works))) {
  :has(foo) {}
}

Expected CSS

@supports (selector(:has(works))) {
  :has(foo) {}
}

Actual CSS

@supports (selector(:has(works))) {
  [\:has\(foo\)] {}
  :has(foo) {}
}

Does it happen with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

Yes

Debug output

@supports (selector(:has(works))) {
  [\:has\(foo\)] {}
  :has(foo) {}
}

Extra config

No response

What plugin are you experiencing this issue on?

CSS Has Pseudo

Plugin version

any

What OS are you experiencing this on?

No response

Node Version

any

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Antonio-Laguna added a commit that referenced this issue Apr 10, 2022
Antonio-Laguna added a commit that referenced this issue Apr 12, 2022
* Ignoring `:has()` within `@supports` check

#312

* Updating tests

#312

* Updating CHANGELOG
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 a pull request may close this issue.

1 participant