Skip to content

Update tokens to use lineHeight scale - #1297

Merged
lukasoppermann merged 4 commits into
mainfrom
lineHeight
Jan 22, 2026
Merged

lukasoppermann merged 4 commits into
mainfrom
lineHeight

Conversation

@lukasoppermann

Copy link
Copy Markdown
Collaborator

Summary

This pull request introduces a set of new base line-height tokens for typography and updates the functional typography tokens to reference these new base tokens. This change improves consistency, maintainability, and reusability of line-height values across the codebase by centralizing their definitions.

@lukasoppermann
lukasoppermann requested review from a team as code owners January 22, 2026 08:41
@lukasoppermann
lukasoppermann requested review from Copilot and jonrohan and removed request for Copilot January 22, 2026 08:41
@changeset-bot

changeset-bot Bot commented Jan 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c95aa6c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/primitives Minor

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actions Bot commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Token Diff (CSS)

/css/base/typography/typography.css

+++ /home/runner/work/primitives/primitives/dist/css/base/typography/typography.css	2026-01-22 14:49:05.414043623 +0000
@@ -1,4 +1,9 @@
:root {
+  --base-text-lineHeight-loose: 1.75; /** Use sparingly for very small text or when maximum readability is critical. Best for footnotes, legal text, or content requiring high accessibility. */
+  --base-text-lineHeight-normal: 1.5; /** Default choice for body text and general UI content. Provides optimal readability for paragraphs, descriptions, and most multi-line text. Use when unsure which line-height to pick. */
+  --base-text-lineHeight-relaxed: 1.625; /** Use for longer-form content, smaller text sizes (12-13px), or when increased readability is desired. Good for text that needs extra breathing room. */
+  --base-text-lineHeight-snug: 1.375; /** Use for display text, large headings, or short multi-line text where moderate density is needed. Good for hero sections and marketing headlines. */
+  --base-text-lineHeight-tight: 1.25; /** Use for single-line text in compact UI elements like labels, badges, buttons, or captions where vertical space is limited. Not recommended for multi-line body text due to reduced readability. */
 --base-text-weight-light: 300;
 --base-text-weight-medium: 500;
 --base-text-weight-normal: 400;

/css/functional/typography/typography.css

+++ /home/runner/work/primitives/primitives/dist/css/functional/typography/typography.css	2026-01-22 14:49:05.372044060 +0000
@@ -3,34 +3,34 @@
 --fontStack-sansSerif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
 --fontStack-sansSerifDisplay: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
 --fontStack-system: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
-  --text-body-lineHeight-large: 1.5;
-  --text-body-lineHeight-medium: 1.42857;
-  --text-body-lineHeight-small: 1.66667;
 --text-body-size-large: 1rem;
 --text-body-size-medium: 0.875rem;
 --text-body-size-small: 0.75rem;
-  --text-caption-lineHeight: 1.3333;
 --text-caption-size: 0.75rem;
-  --text-codeBlock-lineHeight: 1.5385;
 --text-codeBlock-size: 0.8125rem;
 --text-codeInline-size: 0.9285em;
-  --text-display-lineBoxHeight: 1.4;
-  --text-display-lineHeight: 1.4;
 --text-display-size: 2.5rem;
-  --text-subtitle-lineHeight: 1.6;
 --text-subtitle-size: 1.25rem;
-  --text-title-lineHeight-large: 1.5;
-  --text-title-lineHeight-medium: 1.6;
-  --text-title-lineHeight-small: 1.5;
 --text-title-size-large: 2rem;
 --text-title-size-medium: 1.25rem;
 --text-title-size-small: 1rem;
+  --text-body-lineHeight-large: var(--base-text-lineHeight-normal);
+  --text-body-lineHeight-medium: var(--base-text-lineHeight-normal);
+  --text-body-lineHeight-small: var(--base-text-lineHeight-relaxed);
 --text-body-weight: var(--base-text-weight-normal);
+  --text-caption-lineHeight: var(--base-text-lineHeight-tight);
 --text-caption-weight: var(--base-text-weight-normal);
+  --text-codeBlock-lineHeight: var(--base-text-lineHeight-normal);
 --text-codeBlock-weight: var(--base-text-weight-normal);
 --text-codeInline-weight: var(--base-text-weight-normal);
+  --text-display-lineBoxHeight: var(--base-text-lineHeight-snug);
+  --text-display-lineHeight: var(--base-text-lineHeight-snug);
 --text-display-weight: var(--base-text-weight-medium);
+  --text-subtitle-lineHeight: var(--base-text-lineHeight-relaxed);
 --text-subtitle-weight: var(--base-text-weight-normal);
+  --text-title-lineHeight-large: var(--base-text-lineHeight-normal);
+  --text-title-lineHeight-medium: var(--base-text-lineHeight-relaxed);
+  --text-title-lineHeight-small: var(--base-text-lineHeight-normal);
 --text-title-weight-large: var(--base-text-weight-semibold);
 --text-title-weight-medium: var(--base-text-weight-semibold);
 --text-title-weight-small: var(--base-text-weight-semibold);

@github-actions

github-actions Bot commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Token Diff (StyleLint)

/styleLint/base/typography/typography.json

+++ /home/runner/work/primitives/primitives/dist/styleLint/base/typography/typography.json	2026-01-22 14:49:05.414043623 +0000
@@ -1,4 +1,149 @@
{
+  "base-text-lineHeight-loose": {
+    "key": "{base.text.lineHeight.loose}",
+    "$value": 1.75,
+    "$type": "number",
+    "$description": "Use sparingly for very small text or when maximum readability is critical. Best for footnotes, legal text, or content requiring high accessibility.",
+    "$extensions": {
+      "org.primer.figma": {
+        "collection": "typography",
+        "scopes": ["lineHeight"]
+      }
+    },
+    "filePath": "src/tokens/base/typography/typography.json5",
+    "isSource": true,
+    "original": {
+      "$value": 1.75,
+      "$type": "number",
+      "$description": "Use sparingly for very small text or when maximum readability is critical. Best for footnotes, legal text, or content requiring high accessibility.",
+      "$extensions": {
+        "org.primer.figma": {
+          "collection": "typography",
+          "scopes": ["lineHeight"]
+        }
+      },
+      "key": "{base.text.lineHeight.loose}"
+    },
+    "name": "base-text-lineHeight-loose",
+    "attributes": {},
+    "path": ["base", "text", "lineHeight", "loose"]
+  },
+  "base-text-lineHeight-normal": {
+    "key": "{base.text.lineHeight.normal}",
+    "$value": 1.5,
+    "$type": "number",
+    "$description": "Default choice for body text and general UI content. Provides optimal readability for paragraphs, descriptions, and most multi-line text. Use when unsure which line-height to pick.",
+    "$extensions": {
+      "org.primer.figma": {
+        "collection": "typography",
+        "scopes": ["lineHeight"]
+      }
+    },
+    "filePath": "src/tokens/base/typography/typography.json5",
+    "isSource": true,
+    "original": {
+      "$value": 1.5,
+      "$type": "number",
+      "$description": "Default choice for body text and general UI content. Provides optimal readability for paragraphs, descriptions, and most multi-line text. Use when unsure which line-height to pick.",
+      "$extensions": {
+        "org.primer.figma": {
+          "collection": "typography",
+          "scopes": ["lineHeight"]
+        }
+      },
+      "key": "{base.text.lineHeight.normal}"
+    },
+    "name": "base-text-lineHeight-normal",
+    "attributes": {},
+    "path": ["base", "text", "lineHeight", "normal"]
+  },
+  "base-text-lineHeight-relaxed": {
+    "key": "{base.text.lineHeight.relaxed}",
+    "$value": 1.625,
+    "$type": "number",
+    "$description": "Use for longer-form content, smaller text sizes (12-13px), or when increased readability is desired. Good for text that needs extra breathing room.",
+    "$extensions": {
+      "org.primer.figma": {
+        "collection": "typography",
+        "scopes": ["lineHeight"]
+      }
+    },
+    "filePath": "src/tokens/base/typography/typography.json5",
+    "isSource": true,
+    "original": {
+      "$value": 1.625,
+      "$type": "number",
+      "$description": "Use for longer-form content, smaller text sizes (12-13px), or when increased readability is desired. Good for text that needs extra breathing room.",
+      "$extensions": {
+        "org.primer.figma": {
+          "collection": "typography",
+          "scopes": ["lineHeight"]
+        }
+      },
+      "key": "{base.text.lineHeight.relaxed}"
+    },
+    "name": "base-text-lineHeight-relaxed",
+    "attributes": {},
+    "path": ["base", "text", "lineHeight", "relaxed"]
+  },
+  "base-text-lineHeight-snug": {
+    "key": "{base.text.lineHeight.snug}",
+    "$value": 1.375,
+    "$type": "number",
+    "$description": "Use for display text, large headings, or short multi-line text where moderate density is needed. Good for hero sections and marketing headlines.",
+    "$extensions": {
+      "org.primer.figma": {
+        "collection": "typography",
+        "scopes": ["lineHeight"]
+      }
+    },
+    "filePath": "src/tokens/base/typography/typography.json5",
+    "isSource": true,
+    "original": {
+      "$value": 1.375,
+      "$type": "number",
+      "$description": "Use for display text, large headings, or short multi-line text where moderate density is needed. Good for hero sections and marketing headlines.",
+      "$extensions": {
+        "org.primer.figma": {
+          "collection": "typography",
+          "scopes": ["lineHeight"]
+        }
+      },
+      "key": "{base.text.lineHeight.snug}"
+    },
+    "name": "base-text-lineHeight-snug",
+    "attributes": {},
+    "path": ["base", "text", "lineHeight", "snug"]
+  },
+  "base-text-lineHeight-tight": {
+    "key": "{base.text.lineHeight.tight}",
+    "$value": 1.25,
+    "$type": "number",
+    "$description": "Use for single-line text in compact UI elements like labels, badges, buttons, or captions where vertical space is limited. Not recommended for multi-line body text due to reduced readability.",
+    "$extensions": {
+      "org.primer.figma": {
+        "collection": "typography",
+        "scopes": ["lineHeight"]
+      }
+    },
+    "filePath": "src/tokens/base/typography/typography.json5",
+    "isSource": true,
+    "original": {
+      "$value": 1.25,
+      "$type": "number",
+      "$description": "Use for single-line text in compact UI elements like labels, badges, buttons, or captions where vertical space is limited. Not recommended for multi-line body text due to reduced readability.",
+      "$extensions": {
+        "org.primer.figma": {
+          "collection": "typography",
+          "scopes": ["lineHeight"]
+        }
+      },
+      "key": "{base.text.lineHeight.tight}"
+    },
+    "name": "base-text-lineHeight-tight",
+    "attributes": {},
+    "path": ["base", "text", "lineHeight", "tight"]
+  },
 "base-text-weight-light": {
   "key": "{base.text.weight.light}",
   "$type": "fontWeight",

/styleLint/functional/typography/typography.json

+++ /home/runner/work/primitives/primitives/dist/styleLint/functional/typography/typography.json	2026-01-22 14:49:05.370044081 +0000
@@ -123,7 +123,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.5,
+      "$value": "{base.text.lineHeight.normal}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -142,7 +142,7 @@
 },
 "text-body-lineHeight-medium": {
   "key": "{text.body.lineHeight.medium}",
-    "$value": 1.42857,
+    "$value": 1.5,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -156,7 +156,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.42857,
+      "$value": "{base.text.lineHeight.normal}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -175,7 +175,7 @@
 },
 "text-body-lineHeight-small": {
   "key": "{text.body.lineHeight.small}",
-    "$value": 1.66667,
+    "$value": 1.625,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -189,7 +189,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.66667,
+      "$value": "{base.text.lineHeight.relaxed}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -230,7 +230,7 @@
 },
 "text-body-shorthand-medium": {
   "key": "{text.body.shorthand.medium}",
-    "$value": "400 0.875rem,14px/1.42857 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+    "$value": "400 0.875rem,14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
   "$type": "typography",
   "$description": "Default UI font. Most commonly used for body text.",
   "filePath": "src/tokens/functional/typography/typography.json5",
@@ -252,7 +252,7 @@
 },
 "text-body-shorthand-small": {
   "key": "{text.body.shorthand.small}",
-    "$value": "400 0.75rem,12px/1.66667 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+    "$value": "400 0.75rem,12px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
   "$type": "typography",
   "$description": "Small body text for discrete UI applications, such as helper, footnote text. Should be used sparingly across pages. Line-height matches Body (medium) at 20px.",
   "filePath": "src/tokens/functional/typography/typography.json5",
@@ -382,7 +382,7 @@
 },
 "text-caption-lineHeight": {
   "key": "{text.caption.lineHeight}",
-    "$value": 1.3333,
+    "$value": 1.25,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -396,7 +396,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.3333,
+      "$value": "{base.text.lineHeight.tight}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -415,7 +415,7 @@
 },
 "text-caption-shorthand": {
   "key": "{text.caption.shorthand}",
-    "$value": "400 0.75rem,12px/1.3333 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+    "$value": "400 0.75rem,12px/1.25 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
   "$type": "typography",
   "$description": "Compact small font with a smaller line height of 16px. Use it for single-line scenarios, as the small sizing doesn’t pass accessibility requirements.",
   "filePath": "src/tokens/functional/typography/typography.json5",
@@ -491,7 +491,7 @@
 },
 "text-codeBlock-lineHeight": {
   "key": "{text.codeBlock.lineHeight}",
-    "$value": 1.5385,
+    "$value": 1.5,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -505,7 +505,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.5385,
+      "$value": "{base.text.lineHeight.normal}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -524,7 +524,7 @@
 },
 "text-codeBlock-shorthand": {
   "key": "{text.codeBlock.shorthand}",
-    "$value": "400 0.8125rem,13px/1.5385 ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
+    "$value": "400 0.8125rem,13px/1.5 ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
   "$type": "typography",
   "$description": "Default style for rendering code blocks.",
   "filePath": "src/tokens/functional/typography/typography.json5",
@@ -675,7 +675,7 @@
 },
 "text-display-lineBoxHeight": {
   "key": "{text.display.lineBoxHeight}",
-    "$value": 1.4,
+    "$value": 1.375,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -690,7 +690,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.4,
+      "$value": "{base.text.lineHeight.snug}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -710,7 +710,7 @@
 },
 "text-display-lineHeight": {
   "key": "{text.display.lineHeight}",
-    "$value": 1.4,
+    "$value": 1.375,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -724,7 +724,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.4,
+      "$value": "{base.text.lineHeight.snug}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -743,7 +743,7 @@
 },
 "text-display-shorthand": {
   "key": "{text.display.shorthand}",
-    "$value": "500 2.5rem,40px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+    "$value": "500 2.5rem,40px/1.375 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
   "$type": "typography",
   "$description": "Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports.",
   "filePath": "src/tokens/functional/typography/typography.json5",
@@ -819,7 +819,7 @@
 },
 "text-subtitle-lineHeight": {
   "key": "{text.subtitle.lineHeight}",
-    "$value": 1.6,
+    "$value": 1.625,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -833,7 +833,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.6,
+      "$value": "{base.text.lineHeight.relaxed}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -852,7 +852,7 @@
 },
 "text-subtitle-shorthand": {
   "key": "{text.subtitle.shorthand}",
-    "$value": "400 1.25rem,20px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+    "$value": "400 1.25rem,20px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
   "$type": "typography",
   "$description": "Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium).",
   "filePath": "src/tokens/functional/typography/typography.json5",
@@ -942,7 +942,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.5,
+      "$value": "{base.text.lineHeight.normal}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -961,7 +961,7 @@
 },
 "text-title-lineHeight-medium": {
   "key": "{text.title.lineHeight.medium}",
-    "$value": 1.6,
+    "$value": 1.625,
   "$type": "number",
   "$extensions": {
     "org.primer.data": {
@@ -975,7 +975,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.6,
+      "$value": "{base.text.lineHeight.relaxed}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -1008,7 +1008,7 @@
   "filePath": "src/tokens/functional/typography/typography.json5",
   "isSource": true,
   "original": {
-      "$value": 1.5,
+      "$value": "{base.text.lineHeight.normal}",
     "$type": "number",
     "$extensions": {
       "org.primer.data": {
@@ -1049,7 +1049,7 @@
 },
 "text-title-shorthand-medium": {
   "key": "{text.title.shorthand.medium}",
-    "$value": "600 1.25rem,20px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+    "$value": "600 1.25rem,20px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
   "$type": "typography",
   "$description": "Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition.",
   "filePath": "src/tokens/functional/typography/typography.json5",

@github-actions

github-actions Bot commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Token Diff (Figma)

/figma/typography/typography.json

+++ /home/runner/work/primitives/primitives/dist/figma/typography/typography.json	2026-01-22 14:49:10.616006126 +0000
@@ -40,6 +40,41 @@
   "scopes": ["FONT_WEIGHT"]
 },
 {
+    "name": "tight",
+    "value": 1.25,
+    "type": "FLOAT",
+    "description": "Use for single-line text in compact UI elements like labels, badges, buttons, or captions where vertical space is limited. Not recommended for multi-line body text due to reduced readability.",
+    "refId": "tight"
+  },
+  {
+    "name": "snug",
+    "value": 1.375,
+    "type": "FLOAT",
+    "description": "Use for display text, large headings, or short multi-line text where moderate density is needed. Good for hero sections and marketing headlines.",
+    "refId": "snug"
+  },
+  {
+    "name": "normal",
+    "value": 1.5,
+    "type": "FLOAT",
+    "description": "Default choice for body text and general UI content. Provides optimal readability for paragraphs, descriptions, and most multi-line text. Use when unsure which line-height to pick.",
+    "refId": "normal"
+  },
+  {
+    "name": "relaxed",
+    "value": 1.625,
+    "type": "FLOAT",
+    "description": "Use for longer-form content, smaller text sizes (12-13px), or when increased readability is desired. Good for text that needs extra breathing room.",
+    "refId": "relaxed"
+  },
+  {
+    "name": "loose",
+    "value": 1.75,
+    "type": "FLOAT",
+    "description": "Use sparingly for very small text or when maximum readability is critical. Best for footnotes, legal text, or content requiring high accessibility.",
+    "refId": "loose"
+  },
+  {
   "name": "fontStack/system",
   "value": "SF Pro Text",
   "type": "STRING",
@@ -81,9 +116,10 @@
 },
 {
   "name": "lineBoxHeight",
-    "value": 1.4,
+    "value": 1.375,
   "type": "FLOAT",
-    "refId": "lineBoxHeight"
+    "refId": "lineBoxHeight",
+    "reference": "base/text/lineHeight/snug"
 },
 {
   "name": "text/display/size",
@@ -97,9 +133,10 @@
 },
 {
   "name": "lineHeight",
-    "value": 1.4,
+    "value": 1.375,
   "type": "FLOAT",
-    "refId": "lineHeight"
+    "refId": "lineHeight",
+    "reference": "base/text/lineHeight/snug"
 },
 {
   "name": "text/display/weight",
@@ -146,19 +183,22 @@
   "name": "large",
   "value": 1.5,
   "type": "FLOAT",
-    "refId": "large"
+    "refId": "large",
+    "reference": "base/text/lineHeight/normal"
 },
 {
   "name": "medium",
-    "value": 1.6,
+    "value": 1.625,
   "type": "FLOAT",
-    "refId": "medium"
+    "refId": "medium",
+    "reference": "base/text/lineHeight/relaxed"
 },
 {
   "name": "small",
   "value": 1.5,
   "type": "FLOAT",
-    "refId": "small"
+    "refId": "small",
+    "reference": "base/text/lineHeight/normal"
 },
 {
   "name": "text/title/weight/large",
@@ -205,9 +245,10 @@
 },
 {
   "name": "lineHeight",
-    "value": 1.6,
+    "value": 1.625,
   "type": "FLOAT",
-    "refId": "lineHeight"
+    "refId": "lineHeight",
+    "reference": "base/text/lineHeight/relaxed"
 },
 {
   "name": "text/subtitle/weight",
@@ -254,19 +295,22 @@
   "name": "large",
   "value": 1.5,
   "type": "FLOAT",
-    "refId": "large"
+    "refId": "large",
+    "reference": "base/text/lineHeight/normal"
 },
 {
   "name": "medium",
-    "value": 1.42857,
+    "value": 1.5,
   "type": "FLOAT",
-    "refId": "medium"
+    "refId": "medium",
+    "reference": "base/text/lineHeight/normal"
 },
 {
   "name": "small",
-    "value": 1.66667,
+    "value": 1.625,
   "type": "FLOAT",
-    "refId": "small"
+    "refId": "small",
+    "reference": "base/text/lineHeight/relaxed"
 },
 {
   "name": "text/body/weight",
@@ -291,9 +335,10 @@
 },
 {
   "name": "lineHeight",
-    "value": 1.3333,
+    "value": 1.25,
   "type": "FLOAT",
-    "refId": "lineHeight"
+    "refId": "lineHeight",
+    "reference": "base/text/lineHeight/tight"
 },
 {
   "name": "text/caption/weight",
@@ -318,9 +363,10 @@
 },
 {
   "name": "lineHeight",
-    "value": 1.5385,
+    "value": 1.5,
   "type": "FLOAT",
-    "refId": "lineHeight"
+    "refId": "lineHeight",
+    "reference": "base/text/lineHeight/normal"
 },
 {
   "name": "text/codeBlock/weight",

@github-actions

github-actions Bot commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Token Diff (Fallbacks)

/fallbacks/base/typography/typography.json

+++ /home/runner/work/primitives/primitives/dist/fallbacks/base/typography/typography.json	2026-01-22 14:49:05.414043623 +0000
@@ -2,5 +2,10 @@
 "--base-text-weight-light": 300,
 "--base-text-weight-normal": 400,
 "--base-text-weight-medium": 500,
-  "--base-text-weight-semibold": 600
+  "--base-text-weight-semibold": 600,
+  "--base-text-lineHeight-tight": 1.25,
+  "--base-text-lineHeight-snug": 1.375,
+  "--base-text-lineHeight-normal": 1.5,
+  "--base-text-lineHeight-relaxed": 1.625,
+  "--base-text-lineHeight-loose": 1.75
}

/fallbacks/functional/typography/typography.json

+++ /home/runner/work/primitives/primitives/dist/fallbacks/functional/typography/typography.json	2026-01-22 14:49:05.370044081 +0000
@@ -3,45 +3,45 @@
 "--fontStack-sansSerif": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--fontStack-sansSerifDisplay": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--fontStack-monospace": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
-  "--text-display-lineBoxHeight": 1.4,
+  "--text-display-lineBoxHeight": 1.375,
 "--text-display-size": "2.5rem",
-  "--text-display-lineHeight": 1.4,
+  "--text-display-lineHeight": 1.375,
 "--text-display-weight": 500,
-  "--text-display-shorthand": "500 2.5rem/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+  "--text-display-shorthand": "500 2.5rem/1.375 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--text-title-size-large": "2rem",
 "--text-title-size-medium": "1.25rem",
 "--text-title-size-small": "1rem",
 "--text-title-lineHeight-large": 1.5,
-  "--text-title-lineHeight-medium": 1.6,
+  "--text-title-lineHeight-medium": 1.625,
 "--text-title-lineHeight-small": 1.5,
 "--text-title-weight-large": 600,
 "--text-title-weight-medium": 600,
 "--text-title-weight-small": 600,
 "--text-title-shorthand-large": "600 2rem/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
-  "--text-title-shorthand-medium": "600 1.25rem/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+  "--text-title-shorthand-medium": "600 1.25rem/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--text-title-shorthand-small": "600 1rem/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--text-subtitle-size": "1.25rem",
-  "--text-subtitle-lineHeight": 1.6,
+  "--text-subtitle-lineHeight": 1.625,
 "--text-subtitle-weight": 400,
-  "--text-subtitle-shorthand": "400 1.25rem/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+  "--text-subtitle-shorthand": "400 1.25rem/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--text-body-size-large": "1rem",
 "--text-body-size-medium": "0.875rem",
 "--text-body-size-small": "0.75rem",
 "--text-body-lineHeight-large": 1.5,
-  "--text-body-lineHeight-medium": 1.42857,
-  "--text-body-lineHeight-small": 1.66667,
+  "--text-body-lineHeight-medium": 1.5,
+  "--text-body-lineHeight-small": 1.625,
 "--text-body-weight": 400,
 "--text-body-shorthand-large": "400 1rem/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
-  "--text-body-shorthand-medium": "400 0.875rem/1.42857 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
-  "--text-body-shorthand-small": "400 0.75rem/1.66667 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+  "--text-body-shorthand-medium": "400 0.875rem/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+  "--text-body-shorthand-small": "400 0.75rem/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--text-caption-size": "0.75rem",
-  "--text-caption-lineHeight": 1.3333,
+  "--text-caption-lineHeight": 1.25,
 "--text-caption-weight": 400,
-  "--text-caption-shorthand": "400 0.75rem/1.3333 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
+  "--text-caption-shorthand": "400 0.75rem/1.25 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
 "--text-codeBlock-size": "0.8125rem",
-  "--text-codeBlock-lineHeight": 1.5385,
+  "--text-codeBlock-lineHeight": 1.5,
 "--text-codeBlock-weight": 400,
-  "--text-codeBlock-shorthand": "400 0.8125rem/1.5385 ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
+  "--text-codeBlock-shorthand": "400 0.8125rem/1.5 ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
 "--text-codeInline-size": "0.9285em",
 "--text-codeInline-weight": 400,
 "--text-codeInline-shorthand": "400 0.9285em ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace"

@github-actions
github-actions Bot temporarily deployed to Preview (Storybook) January 22, 2026 08:43 Inactive
Copilot AI review requested due to automatic review settings January 22, 2026 11:15
@github-actions
github-actions Bot temporarily deployed to Preview (Storybook) January 22, 2026 11:17 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a new set of base line-height tokens (tight, snug, normal, relaxed, loose) and refactors functional typography tokens to reference these new base tokens instead of using hardcoded numeric values. The goal is to improve consistency and maintainability of line-height values across the design system.

Changes:

  • Added five new base line-height tokens with descriptive names and clear usage guidance
  • Updated functional typography tokens across display, title, subtitle, body, caption, and codeBlock styles to reference the new base tokens
  • Added a changeset documenting the changes

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/tokens/base/typography/typography.json5 Introduces five new base lineHeight tokens (tight: 1.25, snug: 1.375, normal: 1.5, relaxed: 1.625, loose: 1.75) with comprehensive descriptions for each
src/tokens/functional/typography/typography.json5 Updates all functional typography lineHeight values to reference the new base tokens, resulting in value changes for most typography styles
.changeset/upset-ends-switch.md Documents the addition of lineHeight tokens as a minor version change
Comments suppressed due to low confidence (7)

src/tokens/functional/typography/typography.json5:462

  • The line-height value changes from 1.5385 to 1.5 (normal token). This is a breaking change that will affect the visual appearance of codeBlock text. The difference is approximately 0.04, which could affect code readability. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether the original value should be preserved or if a new base token should be created.
        $value: '{base.text.lineHeight.normal}',

src/tokens/functional/typography/typography.json5:71

  • The line-height value changes from 1.4 to 1.375 (snug token). This is a breaking change that will affect the visual appearance of display text. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether a new base token with value 1.4 should be created, or if the snug token value should be adjusted to 1.4.
        $value: '{base.text.lineHeight.snug}',

src/tokens/functional/typography/typography.json5:336

  • The line-height value changes from 1.42857 to 1.5 (normal token). This is a breaking change that will affect the visual appearance of body medium text. The difference is approximately 0.07, which is significant. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether the original value should be preserved or if a new base token should be created.
          $value: '{base.text.lineHeight.normal}',

src/tokens/functional/typography/typography.json5:47

  • The line-height value changes from 1.4 to 1.375 (snug token). This is a breaking change that will affect the visual appearance of display text. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether a new base token with value 1.4 should be created, or if the snug token value should be adjusted to 1.4.
        $value: '{base.text.lineHeight.snug}',

src/tokens/functional/typography/typography.json5:152

  • The line-height value changes from 1.6 to 1.625 (relaxed token). This is a breaking change that will affect the visual appearance of title medium text. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether a new base token with value 1.6 should be created, or if the relaxed token value should be adjusted to 1.6.
          $value: '{base.text.lineHeight.relaxed}',

src/tokens/functional/typography/typography.json5:255

  • The line-height value changes from 1.6 to 1.625 (relaxed token). This is a breaking change that will affect the visual appearance of subtitle text. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether a new base token with value 1.6 should be created, or if the relaxed token value should be adjusted to 1.6.
        $value: '{base.text.lineHeight.relaxed}',

src/tokens/functional/typography/typography.json5:349

  • The line-height value changes from 1.66667 to 1.625 (relaxed token). This is a breaking change that will affect the visual appearance of body small text. The difference is approximately 0.04, which could affect readability. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether the original value should be preserved or if a new base token should be created.
          $value: '{base.text.lineHeight.relaxed}',

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
lineHeight: {
$value: 1.3333,
$value: '{base.text.lineHeight.tight}',

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line-height value changes from 1.3333 to 1.25 (tight token). This is a breaking change that will affect the visual appearance of caption text. The difference is approximately 0.08, which is significant and will make the text more compact. If this is intentional to standardize line-heights, it should be clearly documented in the changeset. If the goal is to maintain the exact same visual appearance, consider whether the original value should be preserved or if a new base token should be created.

This issue also appears in the following locations of the same file:

  • line 462
  • line 71
  • line 336
  • line 47
  • line 152
  • ...and 2 more
Suggested change
$value: '{base.text.lineHeight.tight}',
$value: '1.3333',

Copilot uses AI. Check for mistakes.
'@primer/primitives': minor
---

Added lineHeight tokens

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changeset description "Added lineHeight tokens" is incomplete and potentially misleading. This PR not only adds new base lineHeight tokens but also updates existing functional typography tokens to reference them, which results in breaking changes to actual line-height values (e.g., 1.4 to 1.375, 1.6 to 1.625, 1.42857 to 1.5, etc.). The changeset should clearly document these breaking changes so consumers of this package are aware that upgrading will affect visual appearance.

Suggested change
Added lineHeight tokens
Added base `lineHeight` tokens and updated existing functional typography tokens to reference them.
This changes some actual line-height values (for example: `1.4` → `1.375`, `1.6` → `1.625`, `1.42857` → `1.5`),
which will slightly adjust text vertical spacing. Consumers using these typography tokens should be aware
that upgrading may result in visible changes to line-height.

Copilot uses AI. Check for mistakes.
@github-actions
github-actions Bot temporarily deployed to Preview (Storybook) January 22, 2026 14:50 Inactive
@lukasoppermann
lukasoppermann merged commit bfe0d46 into main Jan 22, 2026
29 checks passed
@lukasoppermann
lukasoppermann deleted the lineHeight branch January 22, 2026 15:29
@primer primer Bot mentioned this pull request Jan 22, 2026

This branch was previously deployed

2 inactive deployments
Preview (Storybook) — c95aa6ca Deployed Jan 22, 2026 by github-actions[bot]
github-pages — c95aa6ca Deployed Jan 22, 2026 by lukasoppermann via Build and deploy / Deploy #3856
Sign up for free to 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.

2 participants