You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecate v5 --color-* tokens (migrate to OKLCH) and remove @graphiql/plugin-explorer (#4416)
## Summary
Collapses the two parallel color systems v6 shipped with — the legacy v5
`--color-*` HSL variables and the v6 OKLCH tokens — down to one, and
removes the last consumer of the old set.
- Migrates every first-party reader of `--color-*` to the v6 OKLCH
tokens in `tokens.css` (core library, `plugin-code-exporter`,
`plugin-collections`, and the `graphiql-webpack` example), following the
idioms already used by the restyled components.
- **Deprecates** `--color-*` rather than deleting it: the v5 README
documented the whole `root.css` variable set as public retheming API,
and the HSL→OKLCH format change rules out a transparent alias. The
variables stay frozen at their v5 values with an inline deprecation
comment; overriding them no longer re-themes GraphiQL, so consumers
should move to the OKLCH tokens.
- **Removes `@graphiql/plugin-explorer`** — the last first-party
`--color-*` reader, now superseded by the default
`@graphiql/plugin-query-builder`. It remains maintained on the v5 LTS
branch.
- Docs: the migration guide gains a `--color-*`→v6 mapping table and its
`plugin-explorer` section moves from deprecation to removal; the READMEs
point retheming at `tokens.css`.
## Test plan
- [ ] On the deploy preview, toggle Light/Dark and confirm text,
borders, icons, hover states, markdown deprecation admonitions, and the
settings dialog all render correctly in both themes.
- [ ] Confirm the default query-builder plugin still opens, and the
explorer plugin is gone from the webpack and CDN examples.
- [ ] In devtools, override `--color-primary` on `.graphiql-container`
and confirm it no longer changes the UI (deprecated); override the
matching OKLCH token (e.g. `--accent-blue`) and confirm it does.
Refs: #4219
7.[Theme, density, and font-size settings](#theme-density-and-font-size-settings)
16
16
8.[Considering for removal in v7](#considering-for-removal-in-v7)
17
17
9.[Other notes](#other-notes)
@@ -26,12 +26,12 @@ Most of this is additive and requires no rewrite: the old `fetcher` prop and the
26
26
27
27
If you don't override GraphiQL's CSS, there's nothing to do here — the new look applies automatically.
28
28
29
-
If you do retheme GraphiQL by overriding CSS custom properties, the important thing to understand is that v6 does **not** replace the old variables with new ones of the same name — it adds a second, parallel token system alongside them. The v5 variables (`--color-primary`, `--color-neutral`, `--color-base`, and so on, defined under `.graphiql-container` as `h, s%, l%` triplets consumed via `hsl(var(--x))`) are untouched and still there. Components that have been restyled for v6 (buttons, dialogs, tabs, the top bar, the activity rail, the settings dialog, and most of the redesigned chrome) read from a new set of OKLCH tokens in `tokens.css` instead. A handful of pieces — the base text and link rules that apply to every `.graphiql-container`/`.graphiql-dialog`, `ButtonGroup`, `MarkdownContent`, and `@graphiql/plugin-explorer` — still read the v5 variables, unchanged.
29
+
If you do retheme GraphiQL by overriding CSS custom properties, the important thing to understand is that v6 does **not** replace the old variables with new ones of the same name — it adds a second, parallel token system and **deprecates the old one**. The v5 variables (`--color-primary`, `--color-neutral`, `--color-base`, and so on, defined under `.graphiql-container` as `h, s%, l%` triplets consumed via `hsl(var(--x))`) are still defined, frozen at their v5 values, but **no v6 component reads them anymore** — every restyled surface reads a new set of OKLCH tokens in `tokens.css` instead. They're retained only as a frozen compatibility surface for your own custom CSS — no first-party code reads them.
30
30
31
31
Practically, that means:
32
32
33
-
-**If you only set a handful of `--color-*`overrides today**, they'll keep applying to whatever still reads them, but they won't touch the restyled surfaces. You'll want to add the new variables to match if you want full coverage.
34
-
-**There is no automatic conversion** between the two systems. Setting `--color-primary` does not change `--accent-blue`, and vice versa. There is no compatibility shim, and the two systems aren't a documented 1:1 mapping — see below and [Considering for removal in v7](#considering-for-removal-in-v7).
33
+
-**Overriding a `--color-*`variable no longer re-themes GraphiQL's built-in UI.** The variables still resolve, so custom CSS of your own that reads them won't break, but because no component reads them, setting `--color-primary` or `--color-neutral` has no effect on the redesigned surfaces. To retheme v6, set the OKLCH tokens instead.
34
+
-**There is no automatic conversion** between the two systems, and no compatibility shim. The formats differ — v5 packs `h, s%, l%` for `hsl()`, v6 packs `L% C H` for `oklch()` — so an old variable can't simply alias a new one. See [Migrating `--color-*` overrides](#migrating---color--overrides) below.
35
35
36
36
### The new variable names
37
37
@@ -50,6 +50,22 @@ There is no published mapping from the nine v5 `--color-*` names to these — th
50
50
51
51
The v5 variables are still documented in the [`@graphiql/react` README](../../packages/graphiql-react/README.md#theming); the new token file itself, [`tokens.css`](../../packages/graphiql-react/src/style/tokens.css), is the source of truth for the v6 set until the README catches up.
52
52
53
+
### Migrating `--color-*` overrides
54
+
55
+
There's no mechanical 1:1 replacement — a single v5 variable often split across several v6 tokens depending on the surface, and which token you want depends on what you're theming. As a starting point, here's where GraphiQL's own internal usages of each v5 variable moved to:
56
+
57
+
| v5 variable | Role | v6 token(s) GraphiQL now uses |
|`--color-secondary`, `--color-tertiary`, `--color-info`| Secondary accents, editor syntax | The `--accent-*` set in `tokens.css`; editor syntax colors are defined in the Monaco theme, not via CSS variables |
66
+
67
+
Remember these are OKLCH triplets composed with `oklch(var(--x))` (and `oklch(var(--x) / <alpha>)` for transparency), not `hsl()`/`hsla()`.
68
+
53
69
### Type-name colors
54
70
55
71
In the schema-aware plugins — the doc explorer and the query builder — type-name references are colored by their GraphQL kind rather than all sharing one color. This makes a field list easier to scan: leaf types stand out from the objects you drill into.
Their stylesheets are bundled into `graphiql`'s own `style.css` regardless of whether they're in your `plugins` list, so opting out removes the panel and rail icon but not the (small) amount of CSS from the bundle.
427
443
428
-
## `@graphiql/plugin-explorer`deprecation
444
+
## `@graphiql/plugin-explorer`removal
429
445
430
-
`@graphiql/plugin-explorer` — the plugin wrapping OneGraph's `graphiql-explorer` library — is deprecated as of v6. It still works exactly as before: same API, same props, no behavior change. But it wraps a library that is no longer actively maintained upstream, and its role is now filled by the first-party `@graphiql/plugin-query-builder` described above, which is default-installed and covers the same "build a query without typing it" use case with fragment, variable, and union/interface support that `graphiql-explorer` never had.
446
+
`@graphiql/plugin-explorer` — the plugin wrapping OneGraph's `graphiql-explorer` library — is **removed in v6**. It wrapped a library that is no longer actively maintained upstream, and its role is now filled by the first-party `@graphiql/plugin-query-builder` described above, which is default-installed and covers the same "build a query without typing it" use case with fragment, variable, and union/interface support that `graphiql-explorer` never had.
431
447
432
-
Calling `explorerPlugin()` now logs a one-time console warning:
433
-
434
-
```
435
-
[@graphiql/plugin-explorer] This package is deprecated. Use the first-party @graphiql/plugin-query-builder instead. Removal planned for v7.
436
-
```
448
+
The package is no longer published from the v6 line. If you still depend on it and can't migrate yet, it remains available on the **v5 LTS branch** — the last `5.x` release stays on npm and is maintained there — but new development targets the query builder.
437
449
438
450
### Migrating
439
451
@@ -465,7 +477,7 @@ If you're using `graphiql` (rather than assembling your own plugin list), the qu
465
477
466
478
Check the [known limitations](../../packages/graphiql-plugin-query-builder/README.md#known-limitations) in the query builder's README before migrating a heavily-scripted or aliased set of operations — a small number of edge cases (repeated aliased fields, explicit `null` arguments) aren't yet covered.
467
479
468
-
`@graphiql/plugin-explorer` is not being removed in this release. It continues to receive the same level of maintenance it has for the past several versions (bug fixes as needed; no new features), and removal is planned for a future major version, not this one.
480
+
If you can't migrate before upgrading to v6, pin `@graphiql/plugin-explorer` to its last `5.x` release from npm and track the v5 LTS branch, where it stays maintained.
469
481
470
482
## Theme, density, and font-size settings
471
483
@@ -512,8 +524,7 @@ Nothing below is happening in v6. These are informal signals about where the pro
512
524
513
525
-**React 18 support.** v6 still supports React 18 and 19 as peer dependencies. A future major version may drop React 18 once the React 19 adoption curve looks similar to where 18 was when 17 support was dropped.
514
526
-**GraphQL.js 15 support.** Similarly, `graphql``^15.5.0` remains a supported peer range in v6 alongside `^16` and `^17`. Expect the floor to move up in a future major version.
515
-
-**The v5 HSL variable set.** As covered in [CSS and retheming](#css-and-retheming), the old `--color-*` variables are untouched in v6 and still drive any component that hasn't been restyled. Once every component is migrated to the OKLCH token set, keeping the old variables alive means maintaining two parallel theming systems indefinitely for the sake of custom CSS that may or may not still target them. We haven't decided whether that warrants a compatibility shim (translating old variable writes into new tokens) or a straightforward removal once migration is complete. If your integration depends heavily on the v5 variable names, now's a good time to start moving to the new tokens and to weigh in on [discussion #4219](https://github.com/graphql/graphiql/discussions/4219).
516
-
-**`@graphiql/plugin-explorer`.** Covered above — deprecated in v6, planned for removal in v7.
527
+
-**The v5 HSL variable set.** The old `--color-*` variables are **deprecated in v6**. They're still defined — frozen at their v5 values — for backward compatibility, but no v6 component reads them: internal usage was migrated to the OKLCH tokens in `tokens.css` (see [CSS and retheming](#css-and-retheming)). A transparent compatibility shim isn't feasible, because the two systems use different color formats — `h, s%, l%` for `hsl()` versus `L% C H` for `oklch()` — so an old variable can't simply alias a new one. Expect the frozen definitions to be removed in v7. If your integration reads or sets the v5 variable names, migrate to the new tokens now (see [Migrating `--color-*` overrides](#migrating---color--overrides)) and weigh in on [discussion #4219](https://github.com/graphql/graphiql/discussions/4219).
Copy file name to clipboardExpand all lines: examples/graphiql-cdn/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# GraphiQL CDN Example
2
2
3
-
This is a simple example of using **GraphiQL** directly from a CDN, including the [GraphiQL Explorer plugin](../../packages/graphiql-plugin-explorer/README.md).
3
+
This is a simple example of using **GraphiQL** directly from a CDN.
4
4
5
5
It loads the latest GraphiQL version from [esm.sh](https://esm.sh), an ESM-based CDN that serves npm packages as ES modules.
0 commit comments