Skip to content

24 ways to impress your friends

Vote up?

Ryan Cannon

The trick with @body::before@ got me thinking—if you’re going to use JavaScript based on the window size, why use media queries at all?

JavaScript has access to window size, pixel density, resize and orientationchange events, activating alternate stylesheets and setting class names on the @<body />@, and these are all techniques that have been around for a long time.

Just a thought.