Skip to content

:deep(<inner-selector>) on vue 2 is not working #8959

Closed
@paul-thebaud

Description

Describe the bug

Hello,

When using the :deep selector inside a Vue 2 single file component's scoped style, such as:

<style scoped>
:deep(.app-child__hello) {
    color: red;
}
</style>

It will generate the given style:

[data-v-7ba5bd90]:deep(.app-child__hello) {
    color: red;
}

Instead of the following:

[data-v-7ba5bd90] .app-child__hello {
    color: red;
}

Using Webpack this example code is working fine. Using CSS or SCSS for the style of the Vue component won't change anything.

I don't know if this related to Vue, Vite or Vite Vue2 plugin so I'm creating an issue here as a starter.

Reproduction

https://github.com/paul-thebaud/vue-deep-bug

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
    CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
    Memory: 2.05 GB / 15.01 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.0/bin/yarn
    npm: 8.5.4 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Firefox: 102.0
  npmPackages:
    vite: ^2.9.13 => 2.9.13

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions