Mediaqueries always at the end? -...

User 91713 Photo


Registered User
83 posts

In this thread
http://www.coffeecup.com/forums/respons … eakpoints/
are views exchanged about standard breakpoints. Depending on where the lay-out breaks you have several different points in your stylesheet , i.e. the menu, content, sub-grids and whatever. My stylesheet is rather long by now and the switching up and down in the stylesheet is somewhat tiresome. I am beginning to think of writing mediaqueries directly in the concerning element. What is your view on the best practice in this case (besides using Sass)?
The perfection isn't reached in one pass.
User 187934 Photo


Senior Advisor
20,245 posts

I write mine in various places depending on the need. If I only need a few I place them near the original rule but if I'm in need of several I place them at the end. I'll even write a separate style sheet if each page requires a lot of unique queries.
A lot depends on your need for speed or clearer code so you can easily make changes.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 10077 Photo


Senior Advisor
1,096 posts

During development, I create several spreadsheets and link to all of them. This makes it easy to find what I need. When the project is completely done, I combine them into one and just link the pages to that one. That way there are fewer requests on the server and the page performs better. It's the best of both worlds for me.
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 271657 Photo


Ambassador
3,816 posts

...of writing mediaqueries directly in the concerning element.

I have done this in the past, but it can quickly get out of hand. Now I put a section at the bottom of the CSS file for all media queries and try to keep them in some order; sections or flexbox stuff first, <h> tags and text next, maps, slideshows, etc. last.

Sometimes I make a separate CSS file to work the media queries out in first, then move it into the main CSS when done.
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 91713 Photo


Registered User
83 posts

Thanks guys for feeding my thoughts. I appreciate it.
The perfection isn't reached in one pass.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.