Skip to content

Grid mess up when using responsive typography #17397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jacobmohl opened this issue Aug 30, 2015 · 5 comments
Closed

Grid mess up when using responsive typography #17397

jacobmohl opened this issue Aug 30, 2015 · 5 comments
Labels

Comments

@jacobmohl
Copy link

I have played around with using responsive typography (see #17095).

When you add responsive font-size on the body element, the container (of properly other things) gets messed up because of the reliance on ems/rems.
Explained: The grid breakpoint in .container is relative to the font-size, so if you increase the font size on bigger screens, then you also increase the breakpoints.

Is this undesired behavior (bug) or should one manually correct the breakpoints to fit with the different font-sizes based on the same breakpoints 😖 ?

@thomas-lebeau
Copy link

I thought so too but in fact em breakpoints are based on a bowser setting (which is default to 16px but can be changed by the user). So the breakpoints value doesn't change according to font size you put in your css.
see: http://blog.w3conversions.com/2015/03/all-your-base-are-belong-to-us-—-or-what-base-size-do-em-based-media-queries-use/

The .container width in the other side do change according to the html font size.

@jacobmohl
Copy link
Author

So the reason for the grid not working properly is that max-width is set in rems and not pixels?

@mdo
Copy link
Member

mdo commented Sep 1, 2015

that max-width is set in rems and not pixels?

Unless there's a typo or mistake somewhere, all our media queries are currently in ems, not rems.

@mdo
Copy link
Member

mdo commented Sep 2, 2015

I believe we'll be moving back to pixels for media queries, so closing this out for now.

@mdo mdo closed this as completed Sep 2, 2015
@cvrebert
Copy link
Collaborator

For posterity: Moved back to pixels in #17403.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants