CSS constants

posted on 7th Jan 2025
less than a minute read


A list of CSS settings which should be constant in any theme or template - no matter what the font base size or unit - from ch to rem.

Width

Body text width (body/min/wrap width) should be between 45 and 70 characters per line.

max-width: 560px

max-width: 560px


If 1rem = 10px max-width: 56rem

width: 56rem = 560px


Using ch = 43.5ch (depends on font)

width: 43.5ch = 560px

Justification

Justification text-align: justify and text-justify: inter-word
Note you need both.

Font smoothing

Use on all sites (lightens all fonts on MacOS)
-webkit-font-smoothing: antialiased

Text rendering

Set text-rendering to auto or don't set at all - this will display ligatures etc.

If you do not want ligatures you must declare
text-rendering: optimizeSpeed.



this is the latest post
HTML elements  |  previous