css variables media queries

CSS
The var() function can not be used as property names, selectors, 
or anything else besides property values. 
(Doing so usually produces invalid syntax, or else a value whose meaning has no
connection to the variable.)

So no, you can't use it in a media query.
Source

Also in CSS: