Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Refactoring media queries seems very undry.

Putting the media queries under each specific element seems very undry to me. I can't see the point to putting all these queries in separate areas instead of just having 1 main media query per screen size. This lets me see all my responsive adjustments in one place.

I know he likes seeing his entire code together but separating them makes looking through my MQ's very tedious if something breaks.

1 Answer

Glenré Charl Labuschagné
Glenré Charl Labuschagné
23,204 Points

Hi Bridger,

It's a case of personal preference. Personally having to scroll up and down through hordes of media queries looking for all the instances of the class you need to update isn't ideal. Having little batches, works better in my opinion and is my preference (learn to love Sass and the includes functionality). Also you shouldn't develop/design for screen sizes: you should work for mobile first and only adjust where needed, because device/screen sizes are constantly changing—and so should we.