Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Incorrect handling of not in media query #2576

@YodasWs

Description

@YodasWs

Not noticing at first a finer point about the not operator in a media query, I attempted the following:

input.scss

input {
  @media not (pointer: fine) {
    background: red;
  }
}

Actual results

libsass 3.5.0.beta.2

@media (pointer: fine) {
  input {
    background: red;
  }
}

⚠️ Notice that libsass has removed the not operator! This is the exact opposite of what I wanted.

Expected result

From MDN:

If you use the not operator, you must specify an explicit media type.

So the correct media query is in fact this:

@media not screen and (pointer: fine) {

ℹ️ I don't expect Sass or libsass to output the above, just an error would suffice.

version info:

$ node-sass --version
node-sass       4.5.3   (Wrapper)       [JavaScript]
libsass         3.5.0.beta.2    (Sass Compiler) [C/C++]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions