Skip to content

Pure selector mistaken as not pure #1572

Closed
@acidfernando

Description

@acidfernando

Bug report

Actual Behavior

I'm using next 14.1.0, so I'm not 100% sure if this issue is css-loader's fault, so I apologize in advance. Here's the thing:

I understand next 14.1.0 is using css-loader in pure mode, and thus you cannot use selectors such as span or body directly. But it is allowed to do .someClassname > span.

The problem is that I think this should be allowed, since it's an equivalent of .someClassname > span

.someClassname {
  ...someStyles

   & > span {
      ...someOtherStyles
   }
}

But it is throwing an error Selector "& > span" is not pure

Expected Behavior

Since the "invalid" nested version and the "valid" version are equivalent, it should allow to use both

How Do We Reproduce?

.test {
    color: red;

    & > span {
        color: green;
    }
}

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