DEV Community

Discussion on: I rebuilt my portfolio🌻 Now it loads in 1.6s 🎉 Here's how I did

simonced profile image

I have a question on that matter.

If a user loads the website on phone in landscape that has more that 768px,
then rotates the screen into portrait, will the mobile.css file be loaded and applied?

That could make a big difference in my work. I could try that on my next project.

Thread Thread
saurabhdaware profile image
Saurabh Daware 🌻 Author

No, it won't be loaded by default since the media is checked on the loading time. However, you can actually call a javascript function which will add that link to head dynamically when a user rotates the screen but it depends if it fits your project needs