Skip to content

Rename color.ansi.* → ansi.* and color.prettylights.syntax.* → prettylights.syntax.*#1352

Open
lukasoppermann wants to merge 1 commit intomainfrom
rename/ansi-color-prettylights-syntax
Open

Rename color.ansi.* → ansi.* and color.prettylights.syntax.* → prettylights.syntax.*#1352
lukasoppermann wants to merge 1 commit intomainfrom
rename/ansi-color-prettylights-syntax

Conversation

@lukasoppermann
Copy link
Copy Markdown
Collaborator

What

Drop the generic color. prefix from ANSI and prettylights syntax tokens to align with the domain-specific naming convention used elsewhere (bgColor, fgColor, borderColor, display).

Changes

Token renames (non-breaking)

Old CSS var New CSS var
--color-ansi-red --ansi-red
--color-prettylights-syntax-keyword --prettylights-syntax-keyword

Backward compatibility

Old tokens are kept as deprecated aliases using var() references:

--color-ansi-red: var(--ansi-red);
--color-prettylights-syntax-keyword: var(--prettylights-syntax-keyword);

Descriptions

Added $description to all 47 individual tokens (17 ANSI + 30 prettylights).

Documentation

Updated contributor-docs/agents/token-authoring.md with:

  • Naming conventions table
  • Deprecation/rename guide
  • Deprecated prefix notes

Validation

  • npm run lint
  • npm run format:fix
  • npm run test (9/9 passed)
  • npm run build
  • ✅ New CSS vars emitted with resolved values
  • ✅ Old CSS vars emitted as var(--new-name) references
  • ✅ DESIGN_TOKENS_SPEC.md updated with new token names and descriptions

…lights.syntax.*

Drop the generic 'color.' prefix from ANSI and prettylights syntax tokens
to align with domain-specific naming (bgColor, fgColor, borderColor, display).

New CSS vars: --ansi-red, --prettylights-syntax-keyword
Old CSS vars kept as deprecated aliases: --color-ansi-red: var(--ansi-red)

- Add $description to all 47 individual tokens
- Add deprecated aliases with $deprecated field for migration
- Update token-authoring.md with naming conventions and deprecation guide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lukasoppermann lukasoppermann requested a review from a team as a code owner April 15, 2026 10:31
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 55a844d

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

@github-actions
Copy link
Copy Markdown
Contributor

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

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

Design Token Diff (Figma)

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

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

This PR updates functional syntax color token naming by promoting ansi.* and prettylights.syntax.* to first-class (non-color.*) token groups, while retaining the previous color.ansi.* and color.prettylights.syntax.* names as deprecated aliases for backward compatibility.

Changes:

  • Renames token paths from color.ansi.*ansi.* and color.prettylights.syntax.*prettylights.syntax.*.
  • Adds deprecated alias tokens that reference the new canonical tokens via {...} references (and marks them with $deprecated + “Deprecated. Use … instead.” descriptions).
  • Updates token authoring documentation with guidance for renames/deprecations and naming conventions.
Show a summary per file
File Description
src/tokens/functional/color/syntax.json5 Introduces new canonical ansi.* and prettylights.syntax.* token groups and adds deprecated color.* aliases.
contributor-docs/agents/token-authoring.md Documents conventions for renaming/deprecating tokens and the expected naming patterns.

Copilot's findings

Tip

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

Comments suppressed due to low confidence (2)

src/tokens/functional/color/syntax.json5:396

  • prettylights.syntax.entity-tag changes the dark override from {base.color.neutral.8} to {base.color.green.1} and adds additional color-vision overrides. This is a functional palette change beyond the rename/deprecation work; please confirm it's intentional (and document it) or keep the previous override values to avoid unexpected visual diffs.
            dark: '{base.color.green.1}',
            'dark-tritanopia': '{base.color.blue.1}',
            'dark-tritanopia-high-contrast': '{base.color.blue.1}',
            'dark-protanopia-deuteranopia': '{base.color.blue.1}',
            'dark-protanopia-deuteranopia-high-contrast': '{base.color.blue.1}',

src/tokens/functional/color/syntax.json5:562

  • prettylights.syntax['string-regexp'] modifies several overrides (e.g. dark from {base.color.green.3} to {base.color.green.1}, and the tritanopia/protanopia mappings from *.3 to *.1). If this PR’s scope is limited to renames + deprecated aliases, consider reverting these value changes (or explicitly documenting them) to avoid unexpected syntax highlighting changes across themes.
            dark: '{base.color.green.1}',
            'dark-tritanopia': '{base.color.blue.1}',
            'dark-tritanopia-high-contrast': '{base.color.blue.1}',
            'light-tritanopia': '{base.color.blue.6}',
            'light-tritanopia-high-contrast': '{base.color.blue.6}',
            'dark-protanopia-deuteranopia': '{base.color.blue.1}',
            'dark-protanopia-deuteranopia-high-contrast': '{base.color.blue.1}',
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines 317 to 319
'org.primer.overrides': {
dark: '{base.color.neutral.6}',
dark: '{base.color.neutral.9}',
},
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.

3 participants