Skip to content

:global doesn't work with CSS nesting #12405

Open
@GrantGryczan

Description

@GrantGryczan

Vue version

@d637bd6

Link to minimal reproduction

https://play.vuejs.org/#eNp9UctOwzAQ/BXLJ5BKqgpOIapEUQ9wAAQcfcljSdJuvJYfpVXVf2fjKLSHqJIvnhnvzKyP8smYZBdApjLz0BnMPSyVFiJrFssVVQdR5OW2thR0JVxDAStRgCgwwEx42Ptp3gRrEJJszlOUzuYXo/nq/AFBuJIMVIykNVKR403Bdrfi2Lufh96VhGTT6PjYvxaiWQyiKdlgzEIhTkrzyebRjW3kTHr21D9tnWwcaa4cxyhZUmdaBPtufEvaKZmOBkrmiPT7GjFvufSIlw2U2wl84/Y9puSHBQd2B0r+cz63NfiBXn+98fYuyI6qgKy+Qn6CIwx9xkG24uIc+0IX0750hqxvdf3t1nsP2o2l+qBxM1GvJP/785Xq57j3ycO4UXn6A8QMvRw=

Steps to reproduce

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

What is expected?

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

What is actually happening?

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

System Info

No response

Any additional comments?

Remove the nested h1 selector inside :global(body), and then the body's background becomes blue as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: sfc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions