skip to content

In a design system's compact density mode, what goes wrong when a user raises the platform text size, and how should components cope?

level: middleimportance: should knowfreq 42%

answer

  1. fixed heights meet growing text
  2. minimum height, not fixed height
  3. text unit follows the user
  4. WCAG 2.2, 1.4.4, 200 percent
  5. test compact with large text

basics

~20 s

Compact modes that fix row and control heights clip or overlap text when users enlarge it. Components should use minimum heights and padding, keep text in the platform's user-scalable unit, and grow, wrap or reflow as text grows.

solid answer

~40 s

Compact is usually defined by shorter rows and controls; if those heights are fixed, text that the user enlarges gets clipped, truncated or overlaps the next row. On the web, WCAG 2.2 criterion 1.4.4 Resize Text, level AA, requires text to resize up to 200 percent without loss of content or functionality, and 1.4.12 Text Spacing adds line-height and spacing overrides. The fix is to express density as padding and *minimum* sizes, so content decides the final height; keep text in the platform's user-scalable unit so the user's setting always wins; and let rows wrap or stack at large sizes. Some systems also relax compact to comfortable past a text-size threshold. The rule: density sets the space around content, the user sets the text size.

go deeper

for a junior

Recall the rule: density sets the space around content, the user's setting sets text size, and text wins when they collide.

for a middle

Explain why fixed heights clip, how minimum heights and user-scalable text units fix it, and what WCAG 2.2 criteria 1.4.4 and 1.4.12 require.

for a senior

Show how you would catch this across a multi-team system: compact plus large text in visual tests, a rule that density never touches text, and layouts that wrap or stack.

for a principal

Weigh whether density should relax automatically at large text sizes, and how many mode and text-size combinations the system commits to supporting.

## The failure A compact density mode is usually described in terms of **heights**: a compact row is shorter, a compact field is shorter. If those heights are fixed values, the mode only works at the text size the designer tested. When a user raises the platform's text-size setting, as many people with low vision and many older users do, the text grows and the container does not. The result is clipped labels, cut-off descenders, two-line content overlapping the next row, or truncated values where every value matters, such as the remaining data balance in a telecom self-service app. On the web, WCAG 2.2 criterion **1.4.4 Resize Text**, level **AA**, asks that text can be resized without assistive technology up to **200 percent** without loss of content or functionality. A compact mode that clips at 150 percent fails it. Native apps have the same user setting and show the same failure, and teams that audit native apps against WCAG apply the same intent. ## Build with minimums, not fixed sizes The fix is to express density as **padding and minimum sizes** and let content decide the final size: - A control's height is its **minimum height** or its padding plus its content, whichever is larger. Compact lowers padding and the minimum; it never pins the height. - Rows and cells **grow** when text wraps or enlarges. - Text sizes stay in the platform's **user-scalable** unit, so the user's setting always wins; spacing stays in the unit the system uses for layout. - Truncation is a deliberate, documented choice for specific content, never the side effect of a fixed height. ## Web and native express it differently | Concern | Web | Native mobile | |---|---|---| | User text preference | browser text-size setting and page zoom | operating-system text-size setting | | How text follows it | sizes relative to the user's root text size | a scale-independent text unit or text styles that scale | | Layout spacing | CSS pixels or root-relative sizes | density-independent units | | Typical failure | fixed-height rows clip at 200 percent | fixed-height cells clip at the largest text sizes | On the web that means text sized in a root-relative unit such as `rem`; on one native platform, a scale-independent unit such as `sp`. They are two spellings of the same idea: text follows the user, spacing follows the density mode. ## What else changes at large text sizes 1. **Layouts reflow.** A dense four-column row may need to wrap values or stack into a card when text is very large. On the web, criterion **1.4.10 Reflow**, level AA, already asks content to work at a width equivalent to 320 CSS pixels without scrolling in two dimensions, with exceptions for content that needs a two-dimensional layout, such as data tables. 2. **Density may relax automatically.** Some systems switch a surface from compact to comfortable when the user's text size passes a threshold, because tight spacing around very large text reads worse. This is a product choice, not a requirement. 3. **Targets grow with content.** Because height is content-driven, larger text enlarges controls, which helps the users who asked for larger text. 4. **Text spacing overrides.** Criterion **1.4.12 Text Spacing**, level AA, expects no loss of content when a user sets line height to at least 1.5 times the font size, paragraph spacing to 2 times, letter spacing to 0.12 times and word spacing to 0.16 times. Fixed-height compact rows tend to fail this as well. ## How to test it - Test each density mode at the largest text size you support, not only at the default. - Include the combination of compact plus large text in visual regression checks; that pairing is where defects hide. - Check that no density value caps, overrides or scales a text size. ## The rule to remember Density decides how much **space** surrounds content; the user decides how large the **text** is. When the two collide, text wins and space gives way.

  • Should a design system pick a default density per platform or input type?
    Commonly, yes. Touch-first surfaces tend to default to comfortable because fingers need larger targets, while pointer-driven desktop surfaces can default to compact for data-heavy views. It is a convention, not a rule; whatever the default, every mode must still meet the target-size and text floors, and users should be able to change it.
  • Is it acceptable for a compact mode to shrink text by one step?
    For secondary text such as table metadata, many systems allow one step down, but never below the smallest documented text style and never by overriding the user's setting. The step must be relative to the user's chosen size, so a user who enlarged text still gets proportionally larger text in compact mode.

saying these in an interview costs you the question

  • Compact rows should have fixed heights so every row lines up.
  • Compact mode may override the user's text-size setting.
  • WCAG sets a minimum font size of 16 pixels for body text.
  • Clipping at large text sizes is fine because it is an edge case.
  • Testing the default text size is enough for each density mode.