DEV Community

loading...

Discussion on: How to use Media Queries in HTML, CSS and JavaScript

Collapse
rconr007 profile image
rconr007

I was wondering if instead of:
if ( mediaQueryCondition.matches ) {
document.body.style.cssText =
background-color: red;

}

we could load a CSS file instead here...