Skip to content

Keep GraphiQL's design tokens off the host page - #4786

Draft
trevor-scheer wants to merge 4 commits into
mainfrom
trevor/scope-design-tokens
Draft

trevor-scheer wants to merge 4 commits into
mainfrom
trevor/scope-design-tokens

Conversation

@trevor-scheer

Copy link
Copy Markdown
Contributor

Loading GraphiQL's stylesheet overwrites variables on the host page. For example, a host that defines --radius-md: 42px on :root before loading GraphiQL gets 6px on unrelated controls. The first commit checks the host root and the GraphiQL container separately.

Limit token declarations to GraphiQL containers and standalone portal content. Theme, density, and font-size presets on the document element can still select the appearance of GraphiQL. A custom portal host can opt into the same tokens by adding graphiql-theme to its class list. Existing token names remain available inside those scopes.

Fixes #4773

@changeset-bot

changeset-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bb4a9f4

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

This PR includes changesets to release 1 package
Name Type
@graphiql/react 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

This branch has not been deployed

No deployments
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.

[react] Design tokens are defined on :root, so generic names like --radius-md leak into the host app

1 participant