Skip to content

frontend: PluginSettings: Fix User-installed chip contrast#6110

Open
vtushar06 wants to merge 1 commit into
kubernetes-sigs:mainfrom
vtushar06:pluginsettings-chip-a11y
Open

frontend: PluginSettings: Fix User-installed chip contrast#6110
vtushar06 wants to merge 1 commit into
kubernetes-sigs:mainfrom
vtushar06:pluginsettings-chip-a11y

Conversation

@vtushar06

Copy link
Copy Markdown
Contributor

The "User-installed" plugin chip rendered white text on the info blue (#0288d1), which is 3.85:1 and fails the WCAG AA minimum of 4.5:1 for normal text.

Fix: keep the info background and set the chip text to a dark color, scoped to this chip in PluginSettings so the theme is not changed globally. I checked it across themes: dark text on info.main is 5.44:1 on the light theme and 9.1:1 on the dark theme (info.main #29b6f6), both above 4.5:1. getContrastText is not used here because at our default contrastThreshold it returns white for info.main and would not reach AA.

The typeLabels map is now typed with ChipProps and SxProps instead of any.

Testing

  • tsc, eslint (ci config) and prettier pass.
  • The PluginSettings story tests pass. Snapshots for the MultipleLocations and MigrationScenario stories are updated for the new chip style.

Screenshots

The change only affects the text color of the "User-installed" chip. Before: white text on #0288d1 (3.85:1). After: dark text on the same blue (5.44:1 light, 9.1:1 dark). Happy to attach a before/after image if useful.

Fixes #4592

The "User-installed" chip used MUI color="info", which renders
white text on info.main (#0288d1). That is only 3.85:1, below the
WCAG AA minimum of 4.5:1 for normal text.

Keep the info background but set the chip text to a dark color
locally in PluginSettings, so it is not a global theme change.
Dark text on info.main meets AA in both the light theme (5.44:1)
and the dark theme (9.1:1, info.main #29b6f6). getContrastText is
not used here because at the default contrastThreshold it returns
white for info.main and would not reach 4.5:1.

Also type the chip label map with ChipProps and SxProps instead of
any.

Snapshots for the MultipleLocations and MigrationScenario stories
are updated for the new chip style.

Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vtushar06
Once this PR has been reviewed and has the lgtm label, please assign yolossn for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from illume and sniok June 20, 2026 05:35
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 20, 2026
@vtushar06

vtushar06 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

cc @illume @sniok would love to hear your thoughts on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

2 participants