Skip to content

/deep/ doesn't compile exactly like >>> #1035

Closed
@mathieutu

Description

@mathieutu

Version

13.3.0

Steps to reproduce

<style scoped>
    >>> .foo {
        font-weight: bold;
    }
</style>

is compiled to:

[data-v-5026efab] .foo {
font-weight: bold;
}

BUT

<style scoped>
    /deep/ .foo {
        font-weight: bold;
    }
</style>

is compiled to:

[data-v-5026efab].foo {
font-weight: bold;
}

What is expected?

Exact same compilation.

What is actually happening?

Note the removed space during the /deep/ compilation.


For me, it comes from theses lines:

if (next.type === 'combinator' && next.value === ' ') {
next.remove()
}

I don't understand why we should remove the space after just in this case. If it's done on purpose this should be documented:

https://vue-loader.vuejs.org/en/features/scoped-css.html
In those cases you can use the /deep/ combinator instead - it's an alias for >>> and works exactly the same.

I can make a PR if you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions