CSS about font

Collections

Preventing layout shift with numbers using CSS

An example

<button data-count="down">Decrease</button>

<span class="count" aria-live="polite">
	0/5
</div>

<button data-count="up">Increase</button>

The font-variant-numeric: tabular-nums property

.count {
  font-variant-numeric: tabular-nums;
}

Children
  1. Better font loading with the font-display:swap property
  2. How to avoid layout shifts caused by web fonts
  3. Making Google Fonts Faster in 2022