Part of #5119 / #5108. Structural export problem found during the Button migration (#5208), separate from the token-content work in #5221.
Problem
The beta export declares the semantic layer (--eds-text-on-accent, --eds-background-surface-*, …) in a :root block, while the scale aliases it references (--eds-accent-N, --eds-neutral-N, …) only exist under [data-color-scheme="light"|"dark"]. CSS custom properties substitute where they are declared, so on :root the references are guaranteed-invalid unless data-color-scheme sits on <html> itself.
Consequences (empirically confirmed in the Button migration):
Proposed fix
Emit the semantic layer under the same [data-color-scheme] scopes as the aliases (per scheme), which preserves subtree switching. The alternative — giving the aliases :root defaults — sacrifices subtree switching for semantic tokens and should only be chosen deliberately.
This is an export/pipeline change (export config / bundle step in tokens_studio_release.yaml), not a token-content change.
Definition of Done
Part of #5119 / #5108. Structural export problem found during the Button migration (#5208), separate from the token-content work in #5221.
Problem
The beta export declares the semantic layer (
--eds-text-on-accent,--eds-background-surface-*, …) in a:rootblock, while the scale aliases it references (--eds-accent-N,--eds-neutral-N, …) only exist under[data-color-scheme="light"|"dark"]. CSS custom properties substitute where they are declared, so on:rootthe references are guaranteed-invalid unlessdata-color-schemesits on<html>itself.Consequences (empirically confirmed in the Button migration):
<div data-color-scheme="dark">) does not work for the semantic layer — only the aliases declared in the scope rule re-resolve. This breaks the intent of ADR-0004/ADR-0013.document.documentElementfor EDS 2.0 stories.border-focusself-reference,border-disableddouble value — content fixes tracked in Author import-ready Tokens Studio JSON for the missing beta colour tokens #5221).Proposed fix
Emit the semantic layer under the same
[data-color-scheme]scopes as the aliases (per scheme), which preserves subtree switching. The alternative — giving the aliases:rootdefaults — sacrifices subtree switching for semantic tokens and should only be chosen deliberately.This is an export/pipeline change (export config / bundle step in
tokens_studio_release.yaml), not a token-content change.Definition of Done
<html>-attribute requirement explicitly documented as the contract)