Skip to content

Adding metadata#1306

Merged
lukasoppermann merged 7 commits intomainfrom
guidelines
Jan 30, 2026
Merged

Adding metadata#1306
lukasoppermann merged 7 commits intomainfrom
guidelines

Conversation

@lukasoppermann
Copy link
Collaborator

@lukasoppermann lukasoppermann commented Jan 30, 2026

Adding metadata:

  • shadow tokens
  • display tokens
  • ansi colors
  • syntax colors

Copilot AI review requested due to automatic review settings January 30, 2026 11:27
@lukasoppermann lukasoppermann requested review from a team as code owners January 30, 2026 11:27
@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 13fe473

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 Patch

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
Copy link
Contributor

github-actions bot commented Jan 30, 2026

Design Token Diff (CSS)

The message is too long to be displayed here. For more details, please check the job summary.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

Design Token Diff (StyleLint)

The message is too long to be displayed here. For more details, please check the job summary.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

Design Token Diff (Figma)

/figma/themes/light-colorblind.json

+++ /home/runner/work/primitives/primitives/dist/figma/themes/light-colorblind.json	2026-01-30 12:27:38.651298121 +0000
@@ -91,7 +91,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.05
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -141,7 +141,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.04
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -169,7 +169,7 @@
 },
 {
   "name": "shadow/resting/small/2/blur",
-    "value": 3,
+    "value": 2,
   "type": "FLOAT",
   "scopes": ["EFFECT_FLOAT"],
   "mode": "light protanopia deuteranopia",
@@ -191,7 +191,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.03
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],

/figma/themes/light-high-contrast.json

+++ /home/runner/work/primitives/primitives/dist/figma/themes/light-high-contrast.json	2026-01-30 12:27:39.011299156 +0000
@@ -91,7 +91,7 @@
     "r": 0.00392156862745098,
     "g": 0.01568627450980392,
     "b": 0.03529411764705882,
-      "a": 0.06
+      "a": 0.05
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -141,7 +141,7 @@
     "r": 0.00392156862745098,
     "g": 0.01568627450980392,
     "b": 0.03529411764705882,
-      "a": 0.06
+      "a": 0.04
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -169,7 +169,7 @@
 },
 {
   "name": "shadow/resting/small/2/blur",
-    "value": 3,
+    "value": 2,
   "type": "FLOAT",
   "scopes": ["EFFECT_FLOAT"],
   "mode": "light high contrast",
@@ -191,7 +191,7 @@
     "r": 0.00392156862745098,
     "g": 0.01568627450980392,
     "b": 0.03529411764705882,
-      "a": 0.06
+      "a": 0.03
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],

/figma/themes/light-tritanopia.json

+++ /home/runner/work/primitives/primitives/dist/figma/themes/light-tritanopia.json	2026-01-30 12:27:38.309297138 +0000
@@ -91,7 +91,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.05
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -141,7 +141,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.04
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -169,7 +169,7 @@
 },
 {
   "name": "shadow/resting/small/2/blur",
-    "value": 3,
+    "value": 2,
   "type": "FLOAT",
   "scopes": ["EFFECT_FLOAT"],
   "mode": "light tritanopia",
@@ -191,7 +191,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.03
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],

/figma/themes/light.json

+++ /home/runner/work/primitives/primitives/dist/figma/themes/light.json	2026-01-30 12:27:37.904295974 +0000
@@ -91,7 +91,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.05
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -141,7 +141,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.04
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],
@@ -169,7 +169,7 @@
 },
 {
   "name": "shadow/resting/small/2/blur",
-    "value": 3,
+    "value": 2,
   "type": "FLOAT",
   "scopes": ["EFFECT_FLOAT"],
   "mode": "light",
@@ -191,7 +191,7 @@
     "r": 0.12156862745098039,
     "g": 0.13725490196078433,
     "b": 0.1568627450980392,
-      "a": 0.06
+      "a": 0.03
   },
   "type": "COLOR",
   "scopes": ["EFFECT_COLOR"],

@github-actions github-actions bot temporarily deployed to Preview (Storybook) January 30, 2026 11:29 Inactive

This comment was marked as resolved.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.


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

Comment on lines +1009 to +1129
// Special handling for data visualization colors - use pattern compression
if (category === 'data') {
const categoryDesc = getCategoryDescription(category)
if (categoryDesc) {
lines.push('')
lines.push(categoryDesc)
}
lines.push('')

// Get usage and rules from the first token with LLM metadata
const firstWithMeta = nonSemanticTokens.find(t => t.usage || t.rules)
if (firstWithMeta) {
if (firstWithMeta.usage && firstWithMeta.usage.length > 0) {
lines.push(`**U:** ${firstWithMeta.usage.join(', ')}`)
}
if (firstWithMeta.rules) {
lines.push(`**R:** ${firstWithMeta.rules}`)
}
lines.push('')
}

outputDataVisColorPattern(nonSemanticTokens, lines)
continue
}

// Special handling for display colors - use pattern compression
if (category === 'display') {
const categoryDesc = getCategoryDescription(category)
if (categoryDesc) {
lines.push('')
lines.push(categoryDesc)
}
lines.push('')

// Get usage and rules from the first token with LLM metadata
const firstWithMeta = nonSemanticTokens.find(t => t.usage || t.rules)
if (firstWithMeta) {
if (firstWithMeta.usage && firstWithMeta.usage.length > 0) {
lines.push(`**U:** ${firstWithMeta.usage.join(', ')}`)
}
if (firstWithMeta.rules) {
lines.push(`**R:** ${firstWithMeta.rules}`)
}
lines.push('')
}

outputDisplayColorPattern(nonSemanticTokens, lines)
continue
}

// Special handling for color category (ansi, prettylights subcategories)
if (category === 'color') {
// Separate tokens by subcategory
const ansiTokens = nonSemanticTokens.filter(t => t.name.startsWith('color-ansi-'))
const prettylightsTokens = nonSemanticTokens.filter(t => t.name.startsWith('color-prettylights-'))
const otherTokens = nonSemanticTokens.filter(
t => !t.name.startsWith('color-ansi-') && !t.name.startsWith('color-prettylights-'),
)

// Output ANSI tokens with pattern compression
if (ansiTokens.length > 0) {
lines.push('### ANSI Terminal Colors')
lines.push('')
const ansiMeta = ansiTokens.find(t => t.description)
if (ansiMeta?.description) {
lines.push(ansiMeta.description)
lines.push('')
}
const ansiWithMeta = ansiTokens.find(t => t.usage || t.rules)
if (ansiWithMeta) {
if (ansiWithMeta.usage && ansiWithMeta.usage.length > 0) {
lines.push(`**U:** ${ansiWithMeta.usage.join(', ')}`)
}
if (ansiWithMeta.rules) {
lines.push(`**R:** ${ansiWithMeta.rules}`)
}
lines.push('')
}
outputAnsiColorPattern(ansiTokens, lines)
}

// Output prettylights tokens with prefix grouping
if (prettylightsTokens.length > 0) {
lines.push('### Syntax Highlighting (prettylights)')
lines.push('')
const plMeta = prettylightsTokens.find(t => t.description)
if (plMeta?.description) {
lines.push(plMeta.description)
lines.push('')
}
const plWithMeta = prettylightsTokens.find(t => t.usage || t.rules)
if (plWithMeta) {
if (plWithMeta.usage && plWithMeta.usage.length > 0) {
lines.push(`**U:** ${plWithMeta.usage.join(', ')}`)
}
if (plWithMeta.rules) {
lines.push(`**R:** ${plWithMeta.rules}`)
}
lines.push('')
}
outputPrettylightsPattern(prettylightsTokens, lines)
}

// Output any other color tokens normally
if (otherTokens.length > 0) {
for (const token of otherTokens) {
lines.push(`### ${token.name}`)
if (token.description) {
lines.push(token.description)
}
if (token.usage && token.usage.length > 0) {
lines.push(`**U:** ${token.usage.join(', ')}`)
}
if (token.rules) {
lines.push(`**R:** ${token.rules}`)
}
lines.push('')
}
}
continue
}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

New output paths were added for data, display, and color categories (pattern compression + prettylights/ANSI grouping), but there are no corresponding unit tests asserting the generated markdown for these cases. Since this formatter is already covered by tests, please add targeted cases for the new branches (e.g., data-*-color-*, display-*-scale-*, color-ansi-*, color-prettylights-*) to prevent regressions.

Copilot uses AI. Check for mistakes.
@lukasoppermann lukasoppermann merged commit e4e355f into main Jan 30, 2026
35 checks passed
@lukasoppermann lukasoppermann deleted the guidelines branch January 30, 2026 13:04
@primer primer bot mentioned this pull request Jan 30, 2026
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.

1 participant