matejlatin / Gutenberg

A meaningful web typography starter kit.
Other
2.83k stars 159 forks source link

Misalignment issues #53

Open mihaisavezi opened 7 years ago

mihaisavezi commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 5 years ago

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 commented 4 years ago

@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 commented 4 years ago

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