I understand using @media
queries in CSS, e.g. to apply rules when the browser's window is larger than a certain amount.
I understand that I can also use window.matchMedia()
in Javascript to figure out if a particular query matches.
But how can I actually get the current values of the media that are being used?
e.g. If I wanted to access the values for media
(e.g. screen
, tv
...), orientation
, monochrome
, device-width
or width
or other Media Features Are these accessible through the DOM somewhere?