Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong merge of nested negative media queries (with the keyword NOT) #537

Closed
Revisor opened this issue Dec 6, 2018 · 0 comments
Closed
Assignees
Labels

Comments

@Revisor
Copy link

Revisor commented Dec 6, 2018

Hello, I found a few past issues about this, but it still seems unresolved.

Past issue in Ruby Sass : sass/sass#1831 "Nested media queries using the "not" keyword should not be merged"
Past issue in Libsass: sass/libsass#2425 "Negation is ignored when nested media queries exist"
Past issue here, in Dart-Sass: #244 "Nested negated media query behavior is wrong"

Source:

@media screen and (hover: hover) {
    @media not all and (any-pointer: coarse) {
        @media not all and (any-pointer: none) {
            .all-conditions {
                display: inline;
            }
        }
    }
}

Expected outcome:

@media screen and (hover: hover) {
    @media not all and (any-pointer: coarse) {
        @media not all and (any-pointer: none) {
            .all-conditions {
                display: inline;
            }
        }
    }
}

Expected outcome in Media Queries Level 4 syntax

@media screen and (hover: hover) and (not(any-pointer: coarse)) and (not(any-pointer: none)) {
    .all-conditions {
        display: inline;
    }
}

But this syntax is only theoretical and doesn't work yet in Chrome 70 nor FF 63.

Received outcome in DartSass 1.6.2:

(Empty result)

Received outcome in LibSass 3.5.2:

@media screen and (hover: hover) and (any-pointer: coarse) and (any-pointer: none) {
  .all-conditions {
    display: inline;
  }
}

Wrong rule, the negations have disappeared.

Thank you for taking a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants