Skip to content

Improper handling of combination of pseudo elements and pseudo classes #5

@Wiktor102

Description

@Wiktor102

Problem

There are 2 related issues:

  1. Pseudoclasses don't work properly on pseudo-elements (ex. .element::after:hover).
  2. No support for "direct" pseudo-elements with pseudo-classes. Only pseudo-elements that have a "parent" are currently supported (ex. ::before,::after).

Identified cause

Regardless of the intent, all pseudo-elements are moved to the end of the composed selector:

[pseudoElement] = selector.children.splice(pseudoElementPos, 1);

Moreover, pseudo-classes attached to them are left in their old position. This relates to the above issues in the following way:

  1. Selectors like .myParent .myChild::after:hover get computed as .myParent[scope=scope1] .myChild:hover:not(*scope magic✨*)::after. Notice the place of the :hover.
  2. Selectors like .myParent ::picker(select):popover-open get computed as .myParent :popover-open:not(*scope magic✨*)::picker(select).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions