REMs vertical PX horizontal sizing

I’ve converted all my vertical spacing to REMs, so that at smaller screen sizes I can adjust the root size and all my styling will proportionally reduce.

However, I’m still left with pixels for horizontal sizes:
max-widths
break points

I think this makes sense. If I set max-widths in rem and then reduce the root size, my max-width is reduced and I don’t want it to - I want it to respond to the width of the viewport.

Some people are advocating using rem for break points, but I can’t get my head around that.

Any thoughts?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You got me thinking with this question.

And by “thinking”, I mean “googling”.

And this is what I turned up: The EMs have it: Proportional Media Queries FTW! – Cloud Four

I created http://onrampwebdesign.com using pixel values in the @media queries, and if you set Safari to “zoom text only”, then hit ⌘+ several times, you will see how the layout disintegrates. If I understand what that article is saying correctly, switching to a em/rem based value for the breakpoints should fix that. I’ll put this on the list of things to try on my next project. :slight_smile:

My verdict: Yes, using em for breakpoints is best-practice.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes I read that article. I need to get my head around it!

Unfortunately for me setting my max-widths and break points in rems isn’t going to work. I want to change the root size, thereby changing all font-size, line-height, space-before and after etc in one go (see http://kylegawley.co.uk/posts/building-a-flexible-layout-using-ems-and-the-golden-ratio). But this also reduces my max-widths.

The two are incompatible. So I’m going to use rem and for max-width and break points px.

Mark


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Safari have recently(ish) fixed the issue with pixel based media queries not zooming proportionally so I think you’ll be fine with what you’re doing.

Joe


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options