Skip to content

Let design token tables size their own columns - #2424

Merged
spaceninja merged 1 commit into
mainfrom
fix-token-table-columns
Aug 21, 2026
Merged

Let design token tables size their own columns#2424
spaceninja merged 1 commit into
mainfrom
fix-token-table-columns

Conversation

@spaceninja

Copy link
Copy Markdown
Member

Overview

All nine design token pages pin their first column with <th style={{ width: '10%' }}>, and on the wider tables that produces genuinely broken output rather than merely tight columns. On the Size page the Name column is held at 100px, so size.$font-heading-n2-max renders as four fragments broken mid-word, while the Comment column takes 696px that most rows leave empty. The table ends up more than twice as tall as it needs to be.

Worth knowing why a percentage does that at all, because it is not the usual behaviour: a table cell cannot normally shrink below its min-content width, so a long unbroken token name should just widen the column and override the 10%. What defeats that is base/typography setting overflow-wrap: anywhere on body — that drops min-content to a single character, which makes 10% achievable, so the browser honours it literally. Both rules are reasonable on their own.

This removes the widths and lets the table size columns to their content. There is nothing to replace them with; the browser's automatic layout is the behaviour we want.

Screenshots

Testing

The Size page is the clearest case, since it has the longest token names.

  • On the deploy preview, open Design → Tokens → Size. In the first table, each token name should sit on one line — a few of the longest may wrap, but only at a hyphen, never mid-word. Before this change names broke into four or five fragments like size.$fo / nt- / heading- / n2-max.
  • Check the three columns look sensibly proportioned: Name wide enough for its content, and Comment no longer holding a large empty area on rows that have no comment.
  • Open Design → Tokens → Motion, which has four tables, and Design → Tokens → Font, which has two. Every table should read cleanly, with no column squeezed to a sliver.
  • Spot-check Design → Tokens → Aspect Ratio, Layout, Line Height, Modular Scale, Opacity and Z-index. Same expectation: names on one line, no mid-word breaks.
  • Narrow the browser window to roughly phone width on any of those pages. The tables should shrink to fit and the page should not scroll sideways.

The nine token pages all set `width: 10%` on the first column. A table cell
cannot normally shrink below its min-content width, so a long token name
would just widen the column -- but `base/typography` sets
`overflow-wrap: anywhere` on `body`, which drops min-content to a single
character. The 10% then becomes achievable and the browser honours it, so
`size.$font-heading-n2-max` renders as four fragments broken mid-word while
the Comment column keeps 696px it often leaves empty.
Removing the widths lets the table size its columns to content: on the Size
page the Name column goes from 100px to 262px, nearly every name fits on one
line, and the table is less than half as tall. Checked all nine pages at
1100px and 420px -- no horizontal overflow at either.
@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9dd1f3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlifyBot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for cloudfour-patterns ready!

NameLink
🔨 Latest commit9dd1f3b
🔍 Latest deploy loghttps://app.netlify.com/projects/cloudfour-patterns/deploys/6a88dca8843d050007efa79d
😎 Deploy Previewhttps://deploy-preview-2424--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@spaceninja
spaceninja merged commit 0b1748c into mainAug 21, 2026
8 checks passed
@spaceninja
spaceninja deleted the fix-token-table-columns branch August 21, 2026 23:19
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@spaceninja