Skip to content

Native scope style element in template can cause compiler errorΒ #12456

@lejunyang

Description

@lejunyang

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNp9kT9PwzAQxb+K5blqBpiqUPFHHWAAVDp6iZIjuLhny3cpRVW+O2dbKR2gk3333rN+dz7quxDm+wH0QtfURhtYEfAQlgYN1lVplYJhF1zDIJVSdWf3+SLX1u+CR0BWlm6MJv52YPTyllofQB0VhQblaL3zcaH6CIBqVGNdnYLTSzn6XzBCV2LFNUXEs1yLtIEDi5bKDFgVwro649YzzfI4vtt+viWPMvUxmY1OKNZBfAlsPZLRC5WVpDXO+a+n3OM4wGzqtx/Qfv7R39Ih9Yx+jUAQ97KMk8ZN7IGLvHp7FuYzcee7Ia3ugrgG8m5IjMV2P2An2Ge+TPsoi41ssd/Q6sCANA2VQJNzzH6j5esfLoz+i3s1v845g6MefwDExbv6

Steps to reproduce

image

What is expected?

CSS Scope allows style element like <style>@scope {}</style> exist in normal HTML elements and apply scoped style on parent element, details can be found in MDN
Though this is quite a new feature, and we can use component to avoid compiler detection
I am not sure if we should have an option to allow style element exist in template.

What is actually happening?

style element can cause compiler error and the style node is removed

System Info

No response

Any additional comments?

No response

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