News for hackers. Stuff that matters.
Re:Media Queries are a Hack by ianstormtaylor on Thursday April 04, 2013 @04:29PM (#5495095)
You can't hide an inner element, or completely change the way it acts just by making something "fluid". Making things fluid and using that to make bulletproof modules is a good first step, but it doesn't do everything we need it to do.
Re:Media Queries are a Hack by websitescenes on Thursday April 04, 2013 @04:50PM (#5495240)
You can with LESS. I use LESS on all responsive projects and have done this many times. Obviously it is not vanilla CSS you write in but it is compiled into standard CSS. I really recommend trying it out before you reinvent the wheel.
Re:Media Queries are a Hack by wvenable on Thursday April 04, 2013 @05:02PM (#5495300)
Do you have an example that would resolve the authors situation?
Re:Media Queries are a Hack by tholex on Friday April 05, 2013 @12:57AM (#5496866)
you still have to base it off either the parent (.signup-page .testimonial) or a conditional that's only used on a particular page (.testimonial.compact). The media queries are sub-optimal but it's contained within .testimonial. Here's how it can look:

  .testimonial {
    media screen and (max-width: 900px) {
      font-size: 0.8em;
    }
    &.compact {
      media screen and (max-width: 1200px) {
        font-size: 0.8em;
      }
    }
  }
Re:Media Queries are a Hack by lotyrin on Friday April 05, 2013 @07:45AM (#5497767)
So... no.

What if this thing shows up in 18 places, some of those change sizes on mobile, some of them in turn being reused in several places and then somebody changes something that affects the size (and therefore desired styles) of some but not other of those contexts, and adds 6 more contexts in which the size matters?

I want to say "When displaying a user profile, If there's more than X units of horizontal space, use the large profile image. If there's more than Y units of vertical space show their bio, trimmed to length but avoiding widow sentences and followed by ellipsis. If there's very little room at all, just show their user name."

I know what I want and I can describe it simply and in a way that a machine could implement, but using today's tools it will take significant developer (human) effort (which typically isn't within my client's priorities and ultimately gets neglected).

Re:Media Queries are a Hack by tholex on Friday April 05, 2013 @12:02PM (#5499223)
By all means, I would love to have element queries. They would definitely help in many cases. You would have to limit their use to just those areas of markup where container widths are explicit.

If it shows up in 18 places I bet you there will be two different contexts with the same container size, but different looks, and element queries won't help you at this point. You'll still need to tailor your CSS classes for different contexts.

Re:Media Queries are a Hack by lotyrin on Friday April 05, 2013 @07:39PM (#5501734)
Obviously if I want styles to vary by context of their container, I'll need to create those rules. The desire for and utility of being able to do that is not at all in question. I don't see how having such rules is in any way mutually exclusive with element queries.
Re:Media Queries are a Hack by websitescenes on Thursday April 04, 2013 @05:04PM (#5495305)
Dude, I'm not your teacher. I come here to learn. Sorry, didn't mean to be rude. Just working right now. Maybe I'll post an example later.
Re:Media Queries are a Hack by websitescenes on Friday April 05, 2013 @12:41AM (#5496824)
lol, I'm losing all my valuable karma points!! I'm melting. No, really; I am sorry for being rude. I was being short sighted. I understand the issues encountered in responsive layout are new and evolving. I am sure you will create a great tool that fits your vision. I happen to think that LESS combined with media queries can accomplish any responsive layout I have yet to fathom. I hope that I can post more meaningful comments in the future.