Skip to content

Media query range contexts are sometimes incorrectly downgraded #320

@romainmenke

Description

@romainmenke
@media screen and (not (200px <= width < 500px)) {
	html {
		background-color: green;
	}
}

@media screen and (not (min-width: 200px) and (max-width: 499.999px)) {
	html {
		background-color: purple;
	}
}

I would expect html background color to be purple but it is green.

When adding not before a media feature with a range context the result is a list with not and and on the same level. not (min-width: 200px) and (max-width: 499.999px)

This is not allowed by the specification : https://www.w3.org/TR/mediaqueries-5/#media-conditions

correct transform :

@media screen and (not ((min-width: 200px) and (max-width: 499.999px))) {
	html {
		background-color: purple;
	}
}

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