normalize-opentype.css icon indicating copy to clipboard operation
normalize-opentype.css copied to clipboard

Collapsing inline-blocks with font-size: 0

Open kennethormandy opened this issue 11 years ago • 6 comments

I also tried dropping it into twitter.com via dev tools, and it broke the profile page in Chrome. We use inline blocks for the layout, and font-size:0 to collapse whitespace between elements. Looks like the font-feature-settings prevents that from happening.

https://github.com/necolas/normalize.css/issues/343#issuecomment-47190238

kennethormandy avatar Jun 26 '14 17:06 kennethormandy

Still can’t figure a way around this one. If -webkit-font-feature-settings is on the body tag on Twitter, it breaks the layout.

screen shot 2014-07-02 at 11 38 32

Could be something to do with kerning specifically conflicting with the inline-block and font-size: 0 “hack,” but I haven’t been able to reproduce the bug in a smaller test case yet. Also, it occurs regardless of what kern is set to.

kennethormandy avatar Jul 03 '14 06:07 kennethormandy

Looks like it might be an edge case interaction with Screensmart fonts from H&FJ? I played around with this a bit on my cloud.typography.com dashboard and it caused some weirdness with line breaks. Couldn't reproduce it otherwise. I don't have a license for Gotham Narrow Screensmart so I can't test to say for sure but we could try it with my other licenses.

kpeatt avatar Jul 03 '14 18:07 kpeatt

Ah, nevermind, this is happening if I switch out Gotham on their site for Fira as well.

kpeatt avatar Jul 03 '14 21:07 kpeatt

Thanks for taking a look, it’s entirely possible that there will be a subsequent issue with the Cloud.typography stuff.

I managed to get it down to a simplified test case on Codepen now, and I have some stuff borrowed from Twitter’s stylesheets in a branch for my next try at it.

kennethormandy avatar Jul 03 '14 22:07 kennethormandy

I took a crack at this: http://codepen.io/ry5n/pen/hnoFD

The fix I found (at least for Chrome) is to set font-feature-settings to normal along with font-size: 0 and then restore the desired Opentype settings as well as font size on the children.

ry5n avatar Jul 10 '14 21:07 ry5n

Thanks so much for tackling this, Ryan. That’s what I was hoping for from font-feature-settings: none. It’s only an issue in Chrome so you’ve found the fix as far as I’m concerned.

kennethormandy avatar Jul 13 '14 22:07 kennethormandy