Skip to content
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

Misalignment issues #53

Open
mihaisavezi opened this issue Oct 1, 2016 · 7 comments
Open

Misalignment issues #53

mihaisavezi opened this issue Oct 1, 2016 · 7 comments

Comments

@mihaisavezi
Copy link

mihaisavezi commented Oct 1, 2016

The idea is amazing. But this is how it currently looks on my screen. It doesn't quite work. I've seen a similar project called sassline, where the aim is the same - vertical rhythm. I think he has a different technique which is more in line with how browsers handle line-height.

An extract from an article he's written: --> https://medium.com/@jakegiltsoff/sassline-v2-0-e424b2881e7e#.bipkreol0

Time to look back at that cap-height value. The cap-height should be thought of as the equivalent of x-height but for capital letters. Using this height we can accurately set text to a baseline grid on the web. Due to the way CSS renders the space around text, we need to shift the text down by a value of font-size / 2 * (line-height — cap-height). If we want the text below it to sit directly on the next baseline, we need to have a negative margin-bottom of the same value. To get 1 baseline worth of space between them we need to get 1rem minus this value (and so on).

image

I haven't gotten round to looking at how you guys handle line-height. But if you think this is something relevant I'd be happy to implement the change.

@matejlatin
Copy link
Owner

Hey @mihaisavezi I'm sorry but I don't see what the problem is... everything seems aligned on the screenshot... Gutenberg uses 0.5 line-height (or leading) for some measurements like margins and how many "line-heights" a heading takes. It can be 1.5, that's why we have this double grid, so you can still see if it fits.

@mihaisavezi
Copy link
Author

I thought the idea of a baseline grid is to have text sit on the baseline --> see this screenshot. Do you see the difference between the two screenshots?

image

@matejlatin
Copy link
Owner

Yeah lots of people asked about this. It's just how line-height works on the web. The text is supposed to be sitting right in the middle of the baseline grid lines.

That can be done on the web, I've seen it already, but it gets tricky when you allow users to be able to change the font and line-height and it could get messed up really quickly.

@morganfeeney
Copy link

morganfeeney commented Mar 7, 2017

I have to agree with @mihaisavezi it looks like a bug. I refer to this article: https://medium.com/written-in-code/aligning-type-to-baseline-the-right-way-using-sass-e258fce47a9b#.i6vsda3o8 as a great, yet simple, explanation of a baseline grid for web type.

@mswiszcz
Copy link

hey @matejlatin even when looking at the gutenberg website and assuming that everything should be in the middle of the line, it looks like there are some missalignments
Capture

@matejlatin
Copy link
Owner

@mswiszcz no it's still correct actually, you need to enable the "double grid". Then those lines will also align. I tend to use the double grid so it gives more flexibility in assigning line heights and font sizes.

@mswiszcz
Copy link

mswiszcz commented Aug 2, 2019

The paragraph at the very top and the one below the first headline are aligned differently, is that expected? Same with 1st and 2nd headlines. It's a bit confusing, not an expert on typo though

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

No branches or pull requests

4 participants