Skip to content

Document dark-mode color token rule in AGENTS.md#3748

Merged
sejas merged 1 commit into
trunkfrom
improve-agents-md-dark-mode-tokens
Jun 10, 2026
Merged

Document dark-mode color token rule in AGENTS.md#3748
sejas merged 1 commit into
trunkfrom
improve-agents-md-dark-mode-tokens

Conversation

@sejas

@sejas sejas commented Jun 9, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

Claude Code analyzed the #3744 dark-theme fix, identified the root cause (renderer components used light-only --wpds-color-* tokens), and drafted the documentation guardrails. I reviewed the wording and scope myself before committing.

Proposed Changes

The Studio Code session UI shipped broken in dark mode because its CSS used --wpds-color-* tokens from @wordpress/ui, which carry hardcoded light fallbacks and don't respond to prefers-color-scheme: dark. Components looked correct in light mode, so the regression slipped through.

This documents the rule so contributors (and AI agents) don't reintroduce it:

  • Renderer CSS must use Studio's dark-aware --color-frame-* tokens for all colors; --wpds-color-* color tokens are banned. Non-color --wpds-* tokens (dimension, typography, border-width, elevation, cursor) remain fine.
  • UI/CSS changes must be verified in both light and dark schemes before being considered done.
  • Adds a CRITICAL pitfall entry referencing the regression for discoverability.

Docs-only change — no runtime impact.

Testing Instructions

  • Read AGENTS.md: confirm the new "Theming / colors (renderer CSS)" rule under Conventions, the dark-mode note in Post-Change Verification, and the "Dark Mode Color Tokens" entry under Common Pitfalls.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (N/A — docs only)

Require --color-frame-* tokens (dark-mode aware) over --wpds-color-*
for renderer CSS, and verify UI in both light and dark schemes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sejas sejas self-assigned this Jun 9, 2026
@sejas sejas requested a review from nightnei June 10, 2026 06:57
@sejas sejas marked this pull request as ready for review June 10, 2026 06:58

@wojtekn wojtekn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

@sejas sejas merged commit f057721 into trunk Jun 10, 2026
11 checks passed
@sejas sejas deleted the improve-agents-md-dark-mode-tokens branch June 10, 2026 08:28
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