I'm trying to apply some css rules for devices with a 2dppx pixel ratio and some others for devices with 3dppx or higher.
As I am only targeting small devices (mobiles and tablets but no retina laptops or TVs) I have a max-width media query surrounding the other two. (edited: removing this media query doesn't solve the problem).
@media only screen and (max-width: 40em) {
@media screen and (min-device-pixel-ratio: 2dppx) and (max-device-pixel-ratio: 2.9dppx){
$base-font-size: 150%;
}
@media screen and (min-device-pixel-ratio: 3dppx) {
$base-font-size: 180%;
}
}
But when I run the web on my iPhone 5s (with a 2dppx), I can see the base-font-size
is equal to 180%, so it seems it's taking the wrong styles. Why is it so?