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

Slight clipping of input text in Chrome 73

Open danielbachhuber opened this issue 7 years ago • 4 comments

image

The corresponding CSS is:

https://github.com/necolas/normalize.css/blob/fc091cce1534909334c1911709a39c22d406977b/normalize.css#L160-L169

Changing line-height to 1.2 or greater fixes the clip.

I'm not experiencing this issue in Firefox 65 though.

Related #769

danielbachhuber avatar Apr 01 '19 15:04 danielbachhuber

The descenders (the "g" characters) are clipping because the particular font-family in use here has a computed content-area height that is significantly more than the computed virtual-area height (that is, the line-height). This might help illuminate the issue: https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align

The corresponding CSS rules you cited presuppose that the font-family that's getting inherited has a computed content-area that's within a typical (normal) range.

line-height: normal is based on font metrics. Using it in this situation will likely prevent clipping,

It would be good to have a reduced test case that loads the font-family depicted in your screenshot

mattbrundage avatar Jul 02 '19 20:07 mattbrundage

add height : 100% to inputs

2020-12-01_4-26-51

mnr73 avatar Dec 01 '20 00:12 mnr73

This occurs in Chrome 87 on Windows with the common font Segoe UI. For example, see the search box at the top left of https://pradyunsg.me/furo/

Setting line-height: normal fixes the problem.

mhsmith avatar Jan 23 '21 18:01 mhsmith

@mhsmith , line-height: normal is -- not coincidentally -- the default value in Chromium, Gecko, and WebKit user agent stylesheets.

There is no longer a need to normalize line-height here. See my previous comment in this issue.

mattbrundage avatar Jan 23 '21 20:01 mattbrundage