masakudamatsu / line-height-picker

A front-end web app that helps web designers/developers pick the best line-height value for their websites
https://line-height-picker.vercel.app
MIT License
2 stars 1 forks source link

Refactor fontPalette.js #198

Closed masakudamatsu closed 4 years ago

masakudamatsu commented 4 years ago

For code readability.

Use rem, not px For a few exceptions, base x-height in px is needed

Values are hardcoded only for

Font-size scale is defined in terms of x-height

or in terms of cap-height

Line-height is first defined in rem, and then mapped into the relative term to font-size

Text crop in em is derived as a function of line-height only

Values are rounded up to 4 decimal points at the end of this file (See #175).

Padding-bottom and -top