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

:global(A) B incorrectly compiles to just A #12404

Open
GrantGryczan opened this issue Nov 15, 2024 · 0 comments
Open

:global(A) B incorrectly compiles to just A #12404

GrantGryczan opened this issue Nov 15, 2024 · 0 comments

Comments

@GrantGryczan
Copy link

GrantGryczan commented Nov 15, 2024

Vue version

@d637bd6

Link to minimal reproduction

https://play.vuejs.org/#eNp9UbtOwzAU/RXLE0glVQVTiCoB6gADRcDoxU0ucVrH17Kv+1DVf+c6VWkH1NHn5XPsvXzyvlgnkKWsCHpvNcFUOSEqM5nOnd0JMl0UBFsS0WCyjTB6DUKLha5XbcDkmpFwSKwDsTFoQSyw2RXVmAOUq8YXqXyMtGNFrNFDw0jZWlxoe5Mtt8JMxD7ffY6+q9FiKIVPwVt4VO6QI4cQdsuRJI5yP11bLCM6HjH4layx952FMPfUoYtKlsfkzGlrcfM2YBQSjE54baBe/YMv4zZjSn4EiBDWoOQfRzq0QEd69vXOr3RB9tgky+or5CdEtCl3PMqeeTPXvtANbV97j4E6137H2ZbAxdOoXDQrD4NeSf7JlyvTz3Xvi4fBxy8qD7+exq0m

Steps to reproduce

In the minimal reproduction, open the Playground's compiled CSS tab.

What is expected?

body h1[data-v-7ba5bd90] {
  background-color: purple;
}

What is actually happening?

body {
  background-color: purple;
}

System Info

No response

Any additional comments?

You can just remove :global( and ) to get the desired effect here, but this is just a minimal reproduction to demonstrate the issue. If this pattern shouldn't be allowed (e.g. because it's useless due to the way scoped CSS is implemented), then this should produce an error instead of this confusingly incorrect output. This wasted a lot of my time.

Note that module doesn't seem to have this issue, only scoped. :deep also seems to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants