Repository navigation
fix(react-ui): Button icons follow the button's text color - #57
Merged
Merged
Conversation
The icon rule hardcoded `--color--ink-link` for every button type, so icons stayed accent-colored on red negative buttons, on primary buttons (near-invisible in light mode), and on disabled buttons. `currentColor` picks up each variant's own ink, matching the CMS's button CSS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
roger-datocms
marked this pull request as draft
September 29, 2026 14:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In Web Previews' config screen, the trash icon on the red Remove frontend button is purple (Basecamp card). The bug is in
datocms-react-ui, not in the plugin.Button/styles.module.csshardcoded--color--ink-linkon every button icon. The rule dates from 2021 (--accent-color, later renamed twice). As a result:negative: accent icon on a red surface.primary: accent icon on an accent surface, near-invisible in light mode.Fix
Icons now use
currentColor, so each variant's own ink applies. This matches the CMS's button CSS (styles/blocks/_button.css), which fills icons withprimary-soft--ink(muted),primary--ink(primary),danger--ink(negative) anddisabled--ink(disabled).ButtonLinkshares these classes and gets the same fix.Visible changes to expect:
ink-linkandprimary-soft--inkboth resolve topigment-550, in every theme.Includes a
patchchangeset fordatocms-react-ui.Before/After Screenshot
(Left = before, right = after)
Testing
A Playwright harness renders the built
ButtoninsideCanvas, for every live appearance option:Each theme's tokens come from the CMS's own pipeline: its pigment and wash ramp builders, its semantic-token CSS, read back the way
readCSSDesignTokensbuildsctx.cssDesignTokens. The harness checks each icon's computedfillagainst both the label color and the CMS's expected token, across 3 types × enabled/disabled.npm run buildandnpm testpass.🤖 Generated with Claude Code