v149 · CSS

Icon Alignment

Without text-box, the text's visual centre sits above the icon's centre because leading is asymmetric. Toggle trim and the debug background to see exactly what gets removed.

Icon + Label pairs

icon midpoint
Explore Features
icon midpoint
Documentation
icon midpoint
Get Started
/* ── Without text-box ─────────────────────────────────────── */
.icon-label {
  font-size: 1.15rem;
  line-height: 1.3;
  /* visual centre is above icon centre — leading asymmetry */
}

/* ── With text-box ────────────────────────────────────────── */
.icon-label {
  font-size: 1.15rem;
  line-height: 1.3;
  text-box: trim-both cap alphabetic;
  /* now cap height top and alphabetic baseline bottom
     are the element edges — flex align-items: center works correctly */
}

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗