I have been trying to figure out whether it's possible to nest CSS feature queries (also known as “CSS @supports
”) and regular media queries, and what would be the correct way to do it.
Example A shows the feature query inside the media query.
Example B shows the media query inside the feature query.
Is it even possible to nest them at all? If so, is there a preferred nesting style? A or B?
.foo {
background: red;
}
/* EXAMPLE A */
@media (min-width: 50em) {
.foo {
background: green;
}
@supports (flex-wrap: wrap) {
.foo {
background: blue;
}
}
}
/* EXAMPLE B */
@supports (flex-wrap: wrap) {
.foo {
background: green;
}
@media (min-width: 50em) {
.foo {
background: blue;
}
}
}