Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

In this Discussion

Shop Talk: CSS

To anyone here who knows what a selector is: I was wondering how you have arranged your CSS for responsive websites. There are a bunch to ways to do this, like separate files with a media query in the LINK tag, or large @media blocks, or little bits of @media withing declarations, but all have advatanges and drawbacks, and I have so far not been able to extract the One True Way by which I mean That One Non-Suck Way That Is Probably Useful For Most Cases.


  • this is the most unexpected comment

    are you okay
  • scot {
       border-line: off-center;
  • We use a precompiler and tend to put whatever media queries we need into the nested structure in whatever rule they apply to.

    That's apart from the overarching grid system which is in a separate file.

    I find it makes things more legible and the more complicated the styling gets, the more I worry about legibility over efficiency.
  • I use a separate mobile.css first ordered by media query width value (highest to lowest) and then ordered by how the selectors are arranged in the primary css.
  • Is that maintainable? It sounds like you get the disadvataneg of having to juggle multiple files, plus the disatvanagtege of having to scroll distances within 1 file.
  • After having three files for main, main-tablet and main-desktop, For the current project, I'm trying inline media queries like Sole's doing, since three files for every feature is getting really annoying. Still, the CSS gets rather messy.
  • edited April 2016
    My IDE (Coda) allows for the side by side view of multiple (and the same) files (as well as easy to jump to bookmarks).

    Also, I've been using the same basic CSS file structure for 7+ years on 100+ sites, so it's pretty easy for me to find stuff.
  • And now I've just decided to tack the mobile on to the end of the primary css file, on less round trip for the browser.

  • Oh my post was done while very tired after a long flight but recently we collaborated on an "adaptive" version of our Magento site with some consultants who were terrible to work with and delivered this sprawling SCSS cobjob after like 9 months and $30k and patching its wounds while not actually ever having used sass/scss was a bummer and I am not pleased with the result in any way (although my overlords are, so I continue to be employed).
  • How does html+css ever take up 9 months and 30K.
  • We asked that question often! Unfortunately the relationship also included them giving us genuine and qualified help with performance issues so we had a delicate ordeal. I was not fully in charge, but I was brought in to occasionally tell them what I thought of their bullshit mess and then obviously I had to clean it up at the end whereupon I gave them a full rundown of all their messes that I cleaned up just as a post-mortem.
  • I don't know. Earning $40k/year to do HTML and CSS used to be reasonable. In this brave new world of web design is that no longer the case?
  • Please bless mommy and daddy and please bless grandma and uncle rick and my stupid sisters and please force all my foes to survive in San Francisco on $40k a year, amen.
  • $40k with or without health insurance?
  • let them get strep uninsured, lord hear our prayer.
  • Oh that's not such a good deal then. Maybe I shouldn't move to Silicon Valley.
  • 1. get hired by Silicon Valley firm with food and gym perks
    2. live in employer's parking lot
    3. use savings to daytrade biotech stocks, accumulating at least 1 share per profitable trade
    4. cancer breakthrough!  are your accumulated shares involved?
    if yes: travel world
    if no: good effort
  • With logic skills like that, I think you should be the one moving to Silicon Valley.
  • I looked around back in 2000 and balked at all the traffic spilling onto surface streets; same shiz has been happening in Seattle, but no other city I've been researching motivates me enough to flee yet.
  • I have heard Minneapolis/St Paul is nice.
  • It is nice, but you have to be hardy to zone 3.
  • It keeps all the wusses out.
  • and it builds character!
  • You know what? You hardy Minnesotans are welcome to your winter. I've had enough. I am pretty sure I would be okay with never again seeing snow, with hanging up my ice skates, with avoiding those terrible grey winter skies, with never living in an igloo, with never cross-country skiing to work. Winter was fun when I was five. It has lost its appeal now.
Sign In or Register to comment.