DEV Community

Discussion on: Front-end best practices (featuring Vue.js)

Collapse
 
pdgurney profile image
Paul Gurney

Hi Daniel,

Write your media queries inside rules, don't write a single media query for everything. This way you won't end up maintaining 2 code structures and you'll also be able to quickly understand how an element will change upon resolution changes.

I think that's a great piece of advice! I started out doing it the other "logical" way, ouch. Your way makes each CSS rule like a mini responsive "component" so to speak.

With our Vue app, we're doing the same: putting component-specific CSS in with its .vue file.