Skip to content

RCT-9930: Render the token accessibility grid only for color tokens - #263

Open
mathevs wants to merge 5 commits into
masterfrom
rct-9930-token-block-rendering-filters-e8c785
Open

RCT-9930: Render the token accessibility grid only for color tokens#263
mathevs wants to merge 5 commits into
masterfrom
rct-9930-token-block-rendering-filters-e8c785

Conversation

@mathevs

@mathevs mathevs commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
  • accessibility grid checked only single token type but there is a chance that some tokens would be different types
  • other blocks seems to be handled correctly

The contrast grid variant checked tokenIds[0] alone, on the assumption
that a block's tokens are always of a single type. Check every token
instead, so a color token in the first position no longer lets tokens of
other types through to getFormattedColor().
@mathevs mathevs self-assigned this Aug 19, 2026
…grid

Checking every token meant a single token of another type suppressed the
entire grid. Filter the ids down to color tokens up front and drive the
grid from that list, so the colors still render and only the unsupported
tokens are left out.
The editor filters a color ramp's token picker down to color tokens, so a
group of font tokens reads as empty there, but the exporter rendered them
anyway through the stack fallback item - the published page showed a ramp
where the editor showed nothing.

Filter the group's and list's tokens to colors up front when the variant
is a stack, and drive the emptiness gate from the filtered list, so a ramp
with no color tokens renders nothing at all rather than a bare group header
above an empty stack.
Check for "stack" and "stack-2" by name instead of any variant key
containing "stack", so the filter matches the two color ramp variants
that actually exist and nothing that might later share the substring.
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.

2 participants