I'm working on a webpage where I often need to use media queries like the following:
@media (min-width: 769px) and (max-width: 1280px) {
...
}
(Or with variables since I'm actually using Sass: (min-width: $vertical-view-max + 1) and (max-width: $medium-view-max)
)
Now, I am in the case where I would like the media query to trigger when the width is not in this interval.
I found that the following rule works fine:
@media (max-width: 768px), (min-width: 1281px) {
...
}
But I can't make it work with not
operator:
@media (not ((min-width: 769px) and (max-width: 1280px))) {
...
}
I tried different parenthesizations (this one even seems to be invalid syntax). How should I write the rule? Is this not possible at all with the not
operator?