Skip to content

Host pseudo-class with compound selector containing pseudo-class causes panic #409

@a-ctor

Description

@a-ctor

Hi,

I am using parcel (v2.8.3 with lightningcss v1.18.0) to compile my Web Components and tried to use the following CSS selector:

:host(:hover) {
    color: red;
}

which causes the following panic:

thread '<unnamed>' panicked at 'internal error: entered unreachable code', D:\a\lightningcss\lightningcss\src\selector.rs:559:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems that pseudo elements inside the compound selector are the issue as :host(.class) works correctly. I tested the :host(:hover) selector in Firefox and Chrome and it is interpreted correctly.

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