Device State Detection with CSS Media Queries and JavaScript Is the user viewing the site in desktop, tablet, or phone screen size? Easy from a CSS perspective but CSS doesn’t directly speak with JavaScript.