@primer/primitives 11.4.0 → 11.4.1-rc.eb8ee149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,446 @@
1
+ # Primer Design Token Guidelines
2
+
3
+ Reference for using GitHub Primer design tokens.
4
+
5
+ ## Legend
6
+
7
+ - **U:** Use cases
8
+ - **R:** Token-specific rules (see Semantic Key for general meaning)
9
+ - **emphasis** variant: Strong/prominent version, use `fg.onEmphasis` for text
10
+ - **muted** variant: Subtle version, use matching `fg.*` color for text
11
+ - **[a, b]** Bracket notation groups related tokens
12
+
13
+ ## Semantic Key
14
+
15
+ These semantic meanings apply across all token types (bgColor, borderColor, fgColor, border).
16
+
17
+ | Semantic | Meaning | Example Usage | Text Pairing |
18
+ |---|---|---|---|
19
+ | **danger** | Errors, destructive actions, critical warnings | delete buttons, error messages, validation errors | fg.danger (muted bg) or fg.onEmphasis (emphasis bg) |
20
+ | **success** | Positive states, confirmations, completed actions | merge buttons, success messages, confirmations | fg.success (muted bg) or fg.onEmphasis (emphasis bg) |
21
+ | **attention** | Warnings, caution states requiring user awareness | warning banners, caution labels, pending states | fg.attention (muted bg) or fg.default (emphasis bg, due to yellow contrast) |
22
+ | **severe** | High-priority warnings, more urgent than attention | urgent messages, escalations, high-priority indicators | fg.severe (muted bg) or fg.onEmphasis (emphasis bg) |
23
+ | **accent** | Selected, focused, or highlighted interactive elements | active states, selected rows, focus indicators | fg.accent (muted bg) or fg.onEmphasis (emphasis bg) |
24
+ | **neutral** | Non-semantic, secondary UI elements | secondary buttons, tags, labels without status meaning | fg.default (muted bg) or fg.onEmphasis (emphasis bg) |
25
+ | **open** | Open/active state indicators (GitHub issues, PRs) | open issues, open PRs, active discussions | fg.open (muted bg) or fg.onEmphasis (emphasis bg) |
26
+ | **closed** | Closed/declined state indicators (GitHub issues, PRs) | closed issues, closed PRs, declined items | fg.closed (muted bg) or fg.onEmphasis (emphasis bg) |
27
+ | **done** | Completed/merged state indicators | merged PRs, completed tasks, finished items | fg.done (muted bg) or fg.onEmphasis (emphasis bg) |
28
+ | **sponsors** | GitHub Sponsors content only | sponsor buttons, funding prompts, sponsor cards | fg.sponsors (muted bg) or fg.onEmphasis (emphasis bg) |
29
+ | **upsell** | Upgrade prompts, premium features, promotional content | upgrade buttons, premium badges, promotional banners | fg.upsell (muted bg) or fg.onEmphasis (emphasis bg) |
30
+
31
+ ## Background Colors
32
+
33
+ Background color tokens for surfaces, containers, and UI elements.
34
+
35
+ **Semantic tokens** (see Semantic Key for meaning):
36
+ - `bgColor-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]-emphasis`
37
+ - `bgColor-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]-muted`
38
+
39
+ ### bgColor-default
40
+ Default background color for pages and main content areas
41
+ **U:** card-background, main-content, page-background
42
+ **R:** Use as the primary background for pages and content areas. Do NOT use for emphasis or highlighting.
43
+
44
+ ### bgColor-disabled
45
+ Background for disabled interactive elements
46
+ **U:** disabled-button, disabled-input, inactive-element
47
+ **R:** MUST use for disabled state backgrounds. Pair -> fg.disabled for text. Do NOT use for active elements.
48
+
49
+ ### bgColor-draft-emphasis
50
+ Strong background for draft state badges and labels
51
+ **U:** draft-badge, draft-label, wip-indicator
52
+ **R:** Use for prominent draft state indicators. Pair -> fg.onEmphasis for text.
53
+
54
+ ### bgColor-draft-muted
55
+ Subtle background for draft state indicators
56
+ **U:** draft-issue, draft-pr, work-in-progress
57
+ **R:** Use for draft/WIP status indicators. Conveys incomplete or pending state.
58
+
59
+ ### bgColor-emphasis
60
+ High-emphasis dark background for strong visual contrast
61
+ **U:** badge-background, high-contrast-element, tooltip
62
+ **R:** Use for elements needing strong visual emphasis. Pair -> fg.onEmphasis for text. Do NOT use for large areas.
63
+
64
+ ### bgColor-inset
65
+ Inset background for recessed content areas like wells or sunken panels
66
+ **U:** recessed-area, sunken-panel, well
67
+ **R:** Use for visually recessed areas. Creates depth hierarchy. Suitable for input fields and wells.
68
+
69
+ ### bgColor-inverse
70
+ Inverse background that flips between light and dark modes
71
+ **U:** inverse-theme-element, overlay-content
72
+ **R:** Use when you need opposite theme background. Pair -> fg.onInverse for text.
73
+
74
+ ### bgColor-muted
75
+ Muted background for secondary content areas and subtle grouping
76
+ **U:** code-block-background, secondary-content, table-header
77
+ **R:** Use for secondary content areas or to create visual grouping. Do NOT use for primary page backgrounds.
78
+
79
+ ### bgColor-transparent
80
+ Fully transparent background
81
+ **U:** ghost-button, icon-button, overlay-trigger
82
+ **R:** Use for ghost/icon buttons or when element should blend with parent. Ensure sufficient contrast for interactive states.
83
+
84
+ ## Border
85
+
86
+ Composite border tokens combining color, width, and style.
87
+
88
+ **Semantic tokens** (see Semantic Key for meaning):
89
+ - `border-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]-emphasis`
90
+ - `border-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]-muted`
91
+
92
+ **Tokens:** border-default, border-disabled, border-emphasis, border-muted, border-transparent
93
+
94
+ ## Border Colors
95
+
96
+ Border color tokens for boundaries, dividers, and outlines.
97
+
98
+ **Semantic tokens** (see Semantic Key for meaning):
99
+ - `borderColor-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]-emphasis`
100
+ - `borderColor-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]-muted`
101
+
102
+ ### borderColor-default
103
+ Default border color for most UI elements
104
+ **U:** card-border, default-border, input-border
105
+ **R:** RECOMMENDED default for all borders. Use for cards, inputs, and dividers.
106
+
107
+ ### borderColor-disabled
108
+ Border color for disabled interactive elements
109
+ **U:** disabled-border, inactive-border, unavailable
110
+ **R:** MUST use for disabled state borders. Pair -> bg.disabled. Do NOT use for active elements.
111
+
112
+ ### borderColor-draft-emphasis
113
+ Strong border for draft state badges
114
+ **U:** draft-emphasis, draft-status
115
+ **R:** Use for emphasized draft state borders. Pair -> bg.draft.emphasis.
116
+
117
+ ### borderColor-draft-muted
118
+ Subtle border for draft state indicators
119
+ **U:** draft-issue, draft-muted, draft-pr
120
+ **R:** Use for draft/WIP status borders. Conveys incomplete or pending state.
121
+
122
+ ### borderColor-emphasis
123
+ Strong border for emphasis and visual weight
124
+ **U:** emphasis-border, selected-border, strong-border
125
+ **R:** Use for borders needing more visual weight. Darker than border.default.
126
+
127
+ ### borderColor-muted
128
+ Subtle border for secondary elements and light separators
129
+ **U:** light-divider, secondary-border, subtle-border
130
+ **R:** Use for subtle borders and separators. Less prominent than border.default.
131
+
132
+ ### borderColor-translucent
133
+ Semi-transparent border for overlays and layered elements
134
+ **U:** overlay-border, translucent-border
135
+ **R:** Use for semi-transparent borders on overlays. Works well with translucent backgrounds.
136
+
137
+ ## Border Radius
138
+
139
+ Corner radius tokens for rounded elements.
140
+
141
+ ### borderRadius-full
142
+ Use this border radius for pill shaped elements
143
+ **U:** avatar, circular-button, pill-badge
144
+ **R:** Use for avatars and pill-shaped elements. Do NOT use for rectangular containers.
145
+
146
+ ### borderRadius-large
147
+ Large border radius (12px). Use for larger containers, dialogs, or when more visual softness is desired. Always use this for buttons.
148
+ **U:** card, dialog, modal
149
+ **R:** Recommended for dialogs and modals.
150
+
151
+ ### borderRadius-medium
152
+ Medium border radius (6px). The default choice for most buttons, cards, and containers
153
+ **U:** button, input, textarea
154
+ **R:** Default choice for most components. Use for inputs, cards, and general containers.
155
+
156
+ ### borderRadius-small
157
+ Small border radius (3px). Use for small variants of components or small UI elements like badges, tags, or anything below 16px in height
158
+ **U:** badge, label, tag
159
+ **R:** Use for small UI elements under 16px height. Do NOT use for buttons or cards.
160
+
161
+ ## Border Width
162
+
163
+ Border thickness tokens.
164
+
165
+ ### borderWidth-thick
166
+ Thick 2px border for emphasis. Use for focus indicators, selected states, or to emphasize important boundaries
167
+ **U:** emphasis-border, focus-indicator, selected-state
168
+ **R:** MUST use for focus rings on interactive elements. Do NOT use for subtle dividers.
169
+
170
+ ## Controls
171
+
172
+ Tokens for interactive controls like buttons, inputs, and selects.
173
+
174
+ **Scale:** Use xsmall/small for dense layouts, medium for default UI, large/xlarge for prominent CTAs.
175
+
176
+ **Size patterns:**
177
+ - `control-[xsmall, small, medium, large, xlarge]-[gap, lineBoxHeight, paddingBlock, paddingInline-normal, size]`
178
+ - `control-[xsmall, medium, large, xlarge]-paddingInline-spacious`
179
+ - `control-[xsmall, small, medium]-paddingInline-condensed`
180
+
181
+ **State variants:**
182
+ - `control-checked-[bgColor-active, bgColor-disabled, bgColor-hover, bgColor-rest, borderColor-active, borderColor-disabled, borderColor-hover, borderColor-rest, fgColor-disabled, fgColor-rest]`
183
+ - `control-transparent-[bgColor-active, bgColor-disabled, bgColor-hover, bgColor-rest, bgColor-selected, borderColor-active, borderColor-hover, borderColor-rest]`
184
+
185
+ **Other tokens:**
186
+ - `control-bgColor-[active, disabled, hover, rest, selected]`
187
+ - `control-borderColor-[danger, disabled, emphasis, rest, selected, success, warning]`
188
+ - `control-danger-bgColor-[active, hover]`
189
+ - `control-danger-fgColor-[hover, rest]`
190
+ - `control-fgColor-[disabled, placeholder, rest]`
191
+ - `control-iconColor-rest`
192
+ - `control-minTarget-[auto, coarse, fine]`
193
+
194
+ ## Control Knob
195
+
196
+ Colors for toggle switch knobs (the circular handle that moves along the track).
197
+
198
+ **U:** slider-thumb, switch-handle, toggle-knob
199
+ **R:** Use for the movable handle/thumb of toggle switches and sliders. Pair -> controlTrack tokens for the background rail.
200
+
201
+ **Tokens:** controlKnob-bgColor-checked, controlKnob-bgColor-disabled, controlKnob-bgColor-rest, controlKnob-borderColor-checked, controlKnob-borderColor-disabled, controlKnob-borderColor-rest
202
+
203
+ ## Control Stack
204
+
205
+ Gap tokens for groups of controls arranged in a row or column.
206
+
207
+ **Scale:** Match gap size to control size. Use condensed for tight groupings, spacious for separated actions.
208
+
209
+ **Size patterns:**
210
+ - `controlStack-[small, medium, large]-[gap-auto, gap-condensed, gap-spacious]`
211
+
212
+ ## Control Track
213
+
214
+ Colors for toggle switch tracks (the background rail that the knob slides along).
215
+
216
+ **U:** slider-track, switch-track, toggle-track
217
+ **R:** Use for the track/rail element of toggle switches and sliders. Pair -> controlKnob tokens for the movable handle.
218
+
219
+ **Tokens:** controlTrack-bgColor-active, controlTrack-bgColor-disabled, controlTrack-bgColor-hover, controlTrack-bgColor-rest, controlTrack-borderColor-disabled, controlTrack-borderColor-rest, controlTrack-fgColor-disabled, controlTrack-fgColor-rest
220
+
221
+ ## Data Visualization
222
+
223
+ Colors for data visualization including charts, graphs, and diagrams. Use these colors to differentiate data series. Emphasis variants are for lines, bars, and borders. Muted variants are for area fills and backgrounds.
224
+
225
+ **U:** bar-fill, chart-series, graph-line
226
+ **R:** Use data colors for visualizations only. Do NOT use for semantic meaning (use bg.success/danger instead). When using multiple series, ensure sufficient contrast between adjacent colors. Pair emphasis with muted variants of the same color for cohesive styling.
227
+
228
+ **Tokens:** data-auburn-color-emphasis, data-auburn-color-muted, data-blue-color-emphasis, data-blue-color-muted, data-brown-color-emphasis, data-brown-color-muted, data-coral-color-emphasis, data-coral-color-muted, data-gray-color-emphasis, data-gray-color-muted, data-green-color-emphasis, data-green-color-muted, data-lemon-color-emphasis, data-lemon-color-muted, data-lime-color-emphasis, data-lime-color-muted, data-olive-color-emphasis, data-olive-color-muted, data-orange-color-emphasis, data-orange-color-muted, data-pine-color-emphasis, data-pine-color-muted, data-pink-color-emphasis, data-pink-color-muted, data-plum-color-emphasis, data-plum-color-muted, data-purple-color-emphasis, data-purple-color-muted, data-red-color-emphasis, data-red-color-muted, data-teal-color-emphasis, data-teal-color-muted, data-yellow-color-emphasis, data-yellow-color-muted
229
+
230
+ ## Easing
231
+
232
+ Animation easing function tokens.
233
+
234
+ ### base-easing-ease
235
+ CSS default easing. Use for hover state changes and micro-interactions.
236
+ **U:** button-hover, hover-state, micro-interaction
237
+ **R:** Use for hover state changes.
238
+
239
+ ### base-easing-easeIn
240
+ Accelerating motion. Use for elements exiting the viewport (moving off-screen).
241
+ **U:** element-leaving, exit-animation, off-screen-motion
242
+ **R:** Rarely used alone. Prefer ease-out for most exit animations.
243
+
244
+ ### base-easing-easeInOut
245
+ Smooth acceleration and deceleration. Use for elements moving or morphing within the viewport.
246
+ **U:** morph-animation, position-change, size-change
247
+ **R:** Use if an element moves or morphs on screen.
248
+
249
+ ### base-easing-easeOut
250
+ Decelerating motion. Use for elements entering the viewport or appearing on screen.
251
+ **U:** element-appearing, enter-animation, modal-open
252
+ **R:** RECOMMENDED default. Use if an element enters or exits the viewport.
253
+
254
+ ### base-easing-linear
255
+ Constant motion with no acceleration. Use for continuous animations like progress bars or loaders.
256
+ **U:** continuous-animation, loader, progress-bar
257
+ **R:** Use if the motion is constant.
258
+
259
+ ## Foreground Colors
260
+
261
+ Text and icon color tokens.
262
+
263
+ **Semantic tokens** (see Semantic Key for meaning):
264
+ - `fgColor-[accent, attention, closed, danger, done, neutral, open, severe, sponsors, success, upsell]`
265
+
266
+ ### fgColor-default
267
+ Default text color for primary content and headings
268
+ **U:** body-text, default-text, heading
269
+ **R:** RECOMMENDED default for all text. Use for headings, body text, and primary labels.
270
+
271
+ ### fgColor-disabled
272
+ Text color for disabled interactive elements
273
+ **U:** disabled-text, inactive-text, unavailable
274
+ **R:** MUST use for disabled state text. Pair -> bg.disabled. Do NOT use for active elements.
275
+
276
+ ### fgColor-draft
277
+ Text color for draft state indicators
278
+ **U:** draft-issue, draft-pr, draft-text
279
+ **R:** Use for draft/WIP status text. Conveys incomplete or pending state.
280
+
281
+ ### fgColor-link
282
+ Text color for hyperlinks
283
+ **U:** hyperlink, link-text
284
+ **R:** MUST use for all text links. Provides expected link affordance.
285
+
286
+ ### fgColor-muted
287
+ Muted text for secondary content and less important information
288
+ **U:** helper-text, muted-text, secondary-text
289
+ **R:** Use for secondary text like timestamps, metadata, and helper text. Do NOT use for primary content.
290
+
291
+ ### fgColor-onEmphasis
292
+ Text color for use on emphasis backgrounds
293
+ **U:** contrast-text, text-on-emphasis
294
+ **R:** MUST use for text on any emphasis background (bg.*.emphasis). Ensures accessibility contrast.
295
+
296
+ ### fgColor-onInverse
297
+ Text color for use on inverse backgrounds
298
+ **U:** inverse-text, text-on-inverse
299
+ **R:** Use for text on bg.inverse. Provides appropriate contrast in both themes.
300
+
301
+ ## Focus
302
+
303
+ Focus ring and outline tokens for keyboard navigation accessibility.
304
+
305
+ ### focus-outline
306
+ Focus ring outline for keyboard navigation and accessibility.
307
+ **U:** accessibility-indicator, focus-ring, keyboard-navigation
308
+ **R:** Always ensure focus states are visible. Do not override with custom focus styles that reduce visibility. Use for interactive elements like buttons, links, and form controls.
309
+
310
+ ### focus-outlineColor
311
+ Outline color for focus states on interactive elements
312
+ **U:** accessibility-indicator, focus-ring, keyboard-navigation
313
+ **R:** Use for focus outlines on interactive elements like buttons, links, and form controls. MUST be visible for keyboard navigation accessibility. Do NOT use for decorative borders or non-interactive elements.
314
+
315
+ ## Font Stacks
316
+
317
+ Font family tokens.
318
+
319
+ ### fontStack-monospace
320
+ Monospace font stack for code, technical content, and tabular data.
321
+ **U:** code-block, inline-code, terminal
322
+ **R:** MUST use for all code display. Use for technical content requiring fixed-width characters.
323
+
324
+ ### fontStack-sansSerif
325
+ Sans-serif font stack for body text and general UI elements.
326
+ **U:** body-text, form-inputs, labels
327
+ **R:** Default font stack for all UI text. Use for body text and standard UI elements. MUST use for readable content.
328
+
329
+ ### fontStack-sansSerifDisplay
330
+ Display font stack for headings and titles. Same as sansSerif but semantically distinct.
331
+ **U:** display-text, heading, title
332
+ **R:** Use for headings and display text. Prefer over sansSerif for titles.
333
+
334
+ ## Outline
335
+
336
+ Outline tokens for focus indicators.
337
+
338
+ ### outline-focus-width
339
+ Focus outline width (2px). Standard width for keyboard focus indicators to meet WCAG 2.4.7 accessibility requirements
340
+ **U:** accessibility, focus-ring, keyboard-focus
341
+ **R:** MUST use for all keyboard focus indicators. Required for WCAG 2.4.7 compliance.
342
+
343
+ ## Overlay
344
+
345
+ Tokens for modals, dialogs, popovers, and dropdown menus.
346
+
347
+ **Scale:** Use xsmall/small for menus and tooltips, medium for dialogs, large/xlarge for complex modals or sheets.
348
+
349
+ **Size patterns:**
350
+ - `overlay-height-[small, medium, large, xlarge]`
351
+ - `overlay-width-[xsmall, small, medium, large, xlarge]`
352
+
353
+ **Other tokens:**
354
+ - `overlay-backdrop-bgColor`
355
+ - `overlay-bgColor-default`
356
+ - `overlay-borderColor-default`
357
+ - `overlay-borderRadius-default`
358
+ - `overlay-offset-default`
359
+ - `overlay-padding-[condensed, normal]`
360
+ - `overlay-paddingBlock-[condensed, normal]`
361
+
362
+ ## Selection
363
+
364
+ Tokens for text selection highlights.
365
+
366
+ ### selection-bgColor
367
+ Background color for text selection highlights
368
+ **U:** highlighted-text, selected-content, text-selection
369
+ **R:** Use for native text selection (::selection) and programmatic text highlighting. Do NOT use for general emphasis or background colors on containers.
370
+
371
+ ## Shadow
372
+
373
+ Box shadow tokens for elevation and depth.
374
+
375
+ ### shadow-floating-large
376
+ Large floating shadow for modals and dialogs
377
+ **U:** dialog, full-screen-overlay, modal
378
+ **R:** MUST use for modals and dialogs. Do NOT use for small floating elements.
379
+
380
+ ### shadow-floating-small
381
+ Small floating shadow for dropdowns, tooltips, and small overlays
382
+ **U:** dropdown, popover, tooltip
383
+ **R:** Use for small floating elements like dropdowns and tooltips. Do NOT use for modals or dialogs.
384
+
385
+ ## Spinner
386
+
387
+ Loading spinner size and stroke tokens.
388
+
389
+ **Scale:** Use small for inline loading, medium for buttons/cards, large for full-page states.
390
+
391
+ **Size patterns:**
392
+ - `spinner-size-[small, medium, large]`
393
+
394
+ **Other tokens:**
395
+ - `spinner-strokeWidth-default`
396
+
397
+ ## Stack
398
+
399
+ Spacing tokens for Stack layout components.
400
+
401
+ **Scale:** Use condensed for dense lists, normal for standard layouts, spacious for prominent sections.
402
+
403
+ **Other tokens:**
404
+ - `stack-gap-[condensed, normal, spacious]`
405
+ - `stack-padding-[condensed, normal, spacious]`
406
+
407
+ ## Typography
408
+
409
+ Text style shorthand tokens for consistent typography across the UI.
410
+
411
+ ### Headings
412
+
413
+ Title and display text styles for headings and hero sections.
414
+
415
+ | Token | Description | U: | R: |
416
+ |---|---|---|---|
417
+ | **text-display-shorthand** | Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports. | hero-section, landing-page, marketing-header | Use sparingly for hero sections. Switch to title.large on narrow viewports. |
418
+ | **text-subtitle-shorthand** | Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium). | subtitle, description, secondary-heading | Use below titles for supporting text. Normal weight distinguishes from title styles. |
419
+ | **text-title-shorthand-large** | Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports. | page-heading, issue-title, pr-title | Use for primary page headings. Switch to title.medium on narrow viewports. |
420
+ | **text-title-shorthand-medium** | Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition. | section-heading, card-title, dialog-title | RECOMMENDED default for page titles. Use for section headings and dialog titles. |
421
+ | **text-title-shorthand-small** | Uses the same size as body (large) with a heavier weight of semibold (600). | subsection-heading, list-title, h3 | Use for smaller headings within sections. Same size as body.large but semibold. |
422
+
423
+ ### Body
424
+
425
+ Body text and caption styles for content and UI labels.
426
+
427
+ | Token | Description | U: | R: |
428
+ |---|---|---|---|
429
+ | **text-body-shorthand-large** | User-generated content, markdown rendering. | markdown-content, article-text, readme | Use for user-generated content and markdown. Better readability for longer text. |
430
+ | **text-body-shorthand-medium** | Default UI font. Most commonly used for body text. | body-text, ui-text, form-label | RECOMMENDED default for UI text. Use for buttons, labels, and general interface text. |
431
+ | **text-body-shorthand-small** | 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. | helper-text, footnote, metadata | Use sparingly for secondary information. Do NOT use for primary content or interactive elements. |
432
+ | **text-caption-shorthand** | 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. | caption, label, badge-text | Use only for single-line or short text. Does NOT meet accessibility requirements for body text. |
433
+
434
+ ### Code
435
+
436
+ Monospace text styles for code blocks and inline code.
437
+
438
+ | Token | Description | U: | R: |
439
+ |---|---|---|---|
440
+ | **text-codeBlock-shorthand** | Default style for rendering code blocks. | code-block, pre-element, code-snippet | MUST use for multi-line code. Use monospace font stack. |
441
+ | **text-codeInline-shorthand** | Inline code blocks using em units to inherit size from its parent. | inline-code, code-element, variable-name | Use for inline code within text. Size inherits from parent using em units. |
442
+
443
+ ---
444
+
445
+ **Final Directive for AI**:
446
+ Always cross-reference the `Semantic Key` at the top of this SPEC before confirming a token choice. If a specific component token is missing, derive it using the `[category]-[semantic]-[variant]` pattern.
@@ -1,10 +1,11 @@
1
1
  import type { FormatFn } from 'style-dictionary/types';
2
2
  /**
3
- * @description Outputs a markdown file with LLM token guidelines, extracting
4
- * description from $description and usage/rules from $extensions['org.primer.llm'].
5
- * Tokens with identical guidelines (from group-level inheritance) are consolidated
6
- * into a single entry listing all token names.
7
- * @param FormatFnArguments
8
- * @returns formatted markdown `string`
3
+ * @description Outputs a hyper-optimized markdown file with LLM token guidelines.
4
+ * Optimizations:
5
+ * - Bracket notation for tokens with identical guidelines
6
+ * - Global category rules extracted to paragraph
7
+ * - Shortened keys (U:, R:, Pair ->)
8
+ * - Max 3 usage items
9
+ * - No boilerplate
9
10
  */
10
11
  export declare const markdownLlmGuidelines: FormatFn;