@media screen and (max-width: env(--width-max)) {
.foo {
font-size: var(--fonts-size);
}
}
:root {
--width-max: 0;
--fonts-size: 1rem;
}
As I understand it, the above code should set a media query on the .foo
element, however it is not being picked up by the browser. I saw the postcss-media-variables library, but would prefer to use env
, but cannot figure out what I am doing wrong. How can I access CSS env variables in a media query?