Skip to content

fix(kimi-web): improve dark mono button contrast#1750

Open
yearth wants to merge 1 commit into
MoonshotAI:mainfrom
yearth:fix/dark-mono-button-contrast
Open

fix(kimi-web): improve dark mono button contrast#1750
yearth wants to merge 1 commit into
MoonshotAI:mainfrom
yearth:fix/dark-mono-button-contrast

Conversation

@yearth

@yearth yearth commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • use a dark foreground token for primary controls in the dark mono theme
  • cover both explicit dark mode and system-following dark mode
  • add a regression test for both CSS selector paths

Testing

  • pnpm --filter @moonshot-ai/kimi-web test
  • pnpm --filter @moonshot-ai/kimi-web typecheck
  • pnpm --filter @moonshot-ai/kimi-web check:style
  • pnpm --filter @moonshot-ai/kimi-web exec vite build --logLevel warn
  • browser computed-style verification: dark mono resolves to #171717 on #e8eaed (14.87:1)

Fixes #1721

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8a9d3ca

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57d94092d6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

html[data-color-scheme="dark"][data-accent="mono"] {
--accent-primary: #e8eaed;
--color-accent: #e8eaed;
--color-text-on-accent: #171717;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep overlay controls readable in dark mono

In the dark mono theme, changing the global --color-text-on-accent token to #171717 fixes near-white accent buttons, but this token is also used for non-accent overlay controls on dark backgrounds, such as Composer.vue's .att-video-badge, .att-lightbox-name, and .att-lightbox-close. When a user opens media attachments or sees a video badge in dark mono, those labels/icons become near-black on rgba(0,0,0,...) overlays and are effectively hidden; consider scoping the dark foreground to primary/accent-filled controls or overriding these overlay controls back to a light foreground.

Useful? React with 👍 / 👎.

@yearth yearth Jul 16, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ab2906f. I rebased onto the latest main, kept --color-text-on-accent for accent-filled controls, and added a stable --color-text-inverse for the dark media overlay. .att-lightbox-name and .att-lightbox-close now use the inverse token. Regression coverage verifies both contracts; the full kimi-web suite (599 tests), typecheck, style check, and build pass.

@yearth
yearth force-pushed the fix/dark-mono-button-contrast branch from 57d9409 to ab2906f Compare July 16, 2026 03:08
@yearth

yearth commented Jul 16, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab2906f1a8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

html[data-color-scheme="dark"][data-accent="mono"] {
--accent-primary: #e8eaed;
--color-accent: #e8eaed;
--color-text-on-accent: #171717;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep off switch thumbs visible in dark mono

In dark mono mode (and the repeated system-dark override below), this global token now resolves to #171717. The shared switch thumb uses background: var(--color-text-on-accent) in apps/kimi-web/src/components/ui/Switch.vue:51 even when the switch is off, while the off track remains the dark --color-line-strong; this makes every off switch in Settings nearly a dark thumb on a dark track (~1.8:1 contrast). Please either limit the dark foreground to accent-filled states or override the off-state switch thumb to a light/inverse fill.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8a9d3ca. The off thumb now uses --color-text-inverse; the .is-on state explicitly switches back to --color-text-on-accent. This restores dark mono off-state contrast to 9.85:1 while preserving 14.87:1 for the on state. Regression coverage now locks both state-specific token contracts; the full kimi-web suite (601 tests), typecheck, style check, and build pass.

@yearth
yearth force-pushed the fix/dark-mono-button-contrast branch from ab2906f to 8a9d3ca Compare July 16, 2026 06:09
@yearth

yearth commented Jul 16, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 8a9d3cac51

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Alfxjx

Alfxjx commented Jul 16, 2026

Copy link
Copy Markdown

你可以贴张效果图嘛

@yearth

yearth commented Jul 16, 2026

Copy link
Copy Markdown
Author
kimi-code-pr-1750-effect

@Alfxjx

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