Document dark-mode color token rule in AGENTS.md#3748
Merged
Conversation
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>
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.
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 toprefers-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:
--color-frame-*tokens for all colors;--wpds-color-*color tokens are banned. Non-color--wpds-*tokens (dimension, typography, border-width, elevation, cursor) remain fine.Docs-only change — no runtime impact.
Testing Instructions
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