Subscribe on changes!

State-Driven Dynamic CSS: v-bind doesn't work inside media queries

avatar
Aug 12th 2021

Version

3.2.2

Reproduction link

https://sfc.vuejs.org/

Steps to reproduce

v-bind after max-width and min-width inside media queries does not provide any data

What is expected?

Expected to see red font with screen width less than 700px

What is actually happening?

We get this css code after compiling: @media only screen and (max-width: v-bind(width)) { div[data-v-f13b4d11] { color: red; } }

avatar
Aug 12th 2021

@harmyderoman your repro link is broken.

avatar
Aug 12th 2021

@harmyderoman your repro link is broken.

fixed

avatar
Aug 12th 2021

I'm not sure if this usage scenario is reasonable.

avatar
Aug 12th 2021

You can't use CSS vars in media query declarations and since Vue relies on them, this is not possible.