Hi Figma team,
I am reporting a recurring design-to-code mismatch around text box height. A Figma auto-height text layer and a browser DOM element can have different outer heights even when the typography panel shows the same font family, font size, font weight, and an explicit pixel line-height. This changes Auto Layout/component heights and makes one-to-one Dev Mode handoff ambiguous.
1. Line-height is not enough to identify the measured box
In CSS, line-height participates in line-box layout; it is not necessarily the height returned for a non-replaced inline element. For example, in current Chromium, with:
font-family: Arial, sans-serif;
font-size: 16px;
font-weight: 400;
line-height: 24px;
margin: 0;
padding: 0;
border: 0;- an inline
<span>has computed line-height24px, butgetBoundingClientRect().heightis17px; - the containing line box is
24pxhigh; - the same element as
inline-blockorblockis24pxhigh.
Figma and Dev Mode expose a text-layer height and line-height, but do not make clear whether that height corresponds to CSS line-box height, font/ink bounds, an inline DOMRect, or Figma-specific canvas font metrics. This regularly causes designers and developers to compare different boxes while believing the values are equivalent.
2. Vertical Trim documentation and CSS mapping appear outdated
The current Figma help page says that Vertical Trim appears in Dev Mode as leading-trim: both and translates to leading-trim and text-edge. Those were draft names. Current CSS uses:
text-box-trim: trim-both;
text-box-edge: cap alphabetic;
/* shorthand */
text-box: trim-both cap alphabetic;Chrome documents this syntax from Chrome 133, and the related browser/Figma mismatch has already been discussed in the forum. The linked WebKit issue was closed as INVALID; a CSS specification editor explained that trimming to cap height and alphabetic baseline requires those metrics to be declared explicitly.
Expected behavior / request
- Dev Mode should explicitly distinguish Figma text-layer bounds from CSS line-box height and inline-element DOMRect/ink bounds.
- Vertical Trim should emit the current standards-track
text-box-trim/text-box-edgesyntax, or clearly document the exact modern CSS needed to reproduce each Figma trim mode. - If Figma intentionally rounds trimmed text bounds to whole pixels while browsers preserve subpixels, Dev Mode should disclose that difference.
- For Vertical Trim off, please document which font metrics Figma uses for the first and last line so that developers can reproduce Auto Layout heights reliably.
Related reports and references
- Text-box-trim/edge inconsistency with browser
- Text Box Vertical Alignment
- Figma is rendering line-height incorrectly
- Vertical Trim rounds to pixel?
- WebKit Bug 261137
- Figma: Explore text properties
- Chrome: CSS text-box-trim
Could the team confirm the intended mapping between a Figma auto-height text layer and the browser CSS box model, and whether Dev Mode/help documentation will be updated to the final text-box syntax?
