I’m trying to set media queries for:
max-width: 414px
max-width: 414px and (orientation: landscape)
The problem I’ve encountered is that it looks like Google Dev Tool is assuming that after rotation the width of the device is now its original height and the height is width, so the second media query doesn’t work in landscape mode. It only works when I set the width of the landscape orientation to the minimum value of the height in portrait orientation.
I am a bit confused as I’ve done a few project and never encountered this scenario. Is this how it works or did I miss something?
This is my sass file:
.container {
width: 300px;
height: 450px;
padding: 30px;
display: grid;
grid-template-rows: 3fr 7fr;
font-size: 1.75rem;
background-color: $dark-grey;
@media (max-width: 414px) {
width: 100%;
height: 80%;
padding: 35px 25px;
}
@media (max-width:414px) and (orientation: landscape) {
height: calc(100vh - 40px);
padding: 20px;
overflow: scroll;
}
}
Thank you!