Skip to content

v6: Replace Monaco editor themes with v6 token palette#4297

Merged
trevor-scheer merged 2 commits into
graphiql-6from
trevor/monaco-theme-registration
May 18, 2026
Merged

v6: Replace Monaco editor themes with v6 token palette#4297
trevor-scheer merged 2 commits into
graphiql-6from
trevor/monaco-theme-registration

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer commented May 17, 2026

Summary

  • Rewrite MONACO_THEME_DATA in constants.ts: both graphiql-DARK and graphiql-LIGHT now cover all GraphQL token types (keywords, types, fields, $variables, @directives, strings, numbers, operators, comments) using the v6 accent palette.
  • Editor surface colors (suggest widget, hover widget, quick input) move from the old pink --color-primary to --accent-green.
  • editor.css: swaps hsl(var(--color-primary)) for oklch(var(--accent-green)) in the .highlight and input:focus-visible rules.
  • Adds monaco-themes.test.ts to pin token rule shapes for both themes.

Test plan

  • Open the editor, write a query with keywords, type names, variables, directives, strings, and a comment; confirm syntax colors match the v6 palette (see the changeset for the token reference).
  • Toggle the theme via the settings dropdown; confirm Monaco switches from dark to light and back, with distinct and correct syntax colors in each.
  • Verify the autocomplete suggestion widget, hover widget, and quick-input palette use the green accent instead of pink.
  • Open the editor with the system set to light mode and no pinned theme; confirm Monaco uses the light palette.

Refs: #4219

Replaces the old hot-pink `primary`/`primaryBg`/`bg`/`secondary` color
palette in `MONACO_THEME_DATA` with values from the v6 OKLCH token table.

Both `graphiql-DARK` and `graphiql-LIGHT` now carry explicit token rules
for every token type the Monaco GraphQL grammar emits: keywords, type
names, field identifiers, `$variable` arguments, `@directive` annotations,
strings, numbers, operators, and comments. Comments are italicized.
UI chrome colors (suggest widget, hover widget, quick input, focus ring)
follow the v6 `--accent-green` slot instead of the old pink.

Adds `monaco-themes.test.ts` to lock down the token rule shapes.
Replaces `hsl(var(--color-primary))` with `oklch(var(--accent-green))`
in the Monaco `.highlight` and `input:focus-visible` rules. Adds the
`EAEEF` hex fragment to the cspell dictionary to clear the lint warning
introduced by the light-theme bg-overlay constant.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 17, 2026

🦋 Changeset detected

Latest commit: 84c4a7f

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

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

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@trevor-scheer trevor-scheer marked this pull request as ready for review May 18, 2026 00:15
@trevor-scheer trevor-scheer merged commit 76a5169 into graphiql-6 May 18, 2026
13 checks passed
@trevor-scheer trevor-scheer deleted the trevor/monaco-theme-registration branch May 18, 2026 00:15
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