Skip to content

Allow sub selectors in conditionals. #747

@Namek

Description

@Namek

Hi, consider the following code:

component Main {
  fun render : Html {
    <div::s(false)>"Hello World!"</div>
  }

  style s(isSelected : Bool) {
    &:hover {
      border: 3px solid blue;
    }

    if (!isSelected) {
      &:not(:hover) {
        border: 3px dashed red;
      }
    }
  }
}

Sandbox: https://mint-lang.com/sandbox/Nr_GNTQ-MiuISg

Expectation: element has red border when it's not hovered
Observation: element doesn't have any border when it's hovered

The :not(:hover) construct works when I delete if (!isSelected) condition.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions