If I have the following scss rule:
.hero-wrapper{
padding: g.$padding-main;
@include r.medium {
padding: calc(g.$padding-main / 2);
}
@include r.small {
padding: calc(g.$padding-main / 4);
}
padding-top: 0;
}
the includes being simple mixins like so
@mixin small() {
@media (max-width: 568px) {
@content;
}
}
Then why does my padding-top get overridden as soon as a media query takes effect in my browser? Or pose the question differently, why is the scss not aware it should apply the property as defined, after the media query. We can see in the compiled css that it gets overridden.
.hero-wrapper {
padding:3rem;
padding-top:0;
}
@media (max-width:768px) {
.hero-wrapper {
padding:1.5rem
}
}
@media (max-width:568px) {
.hero-wrapper {
padding:.75rem
}
}
Is there anything I can do to force a more intuitive behaviour or should I just redefine the padding-top in each query?