Route accessible text colors through @policyengine/design-system#15
Merged
Route accessible text colors through @policyengine/design-system#15
Conversation
The a11y pass added local --color-danger-text and --color-success-text because @policyengine/design-system didn't expose accessible-text companions for error/success. Once policyengine-app-v2#1024 lands and publishes a new design-system release, those tokens become available upstream as --pe-color-text-error and --pe-color-text-success. Switch the locals to var(--pe-color-text-error, #b91c1c) / var(--pe-color-text-success, #285e61) / var(--pe-color-text-warning, #d9480f). This keeps the page rendering identically today and silently picks up the upstream values once the new design-system version is installed — no second PR needed in this repo.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Looks good! This is a clean backward-compatible migration that prepares for the upstream design-system tokens.
Verified:
- All three fallback hex values match their current computed values:
--color-warning-text:#d9480fmatches--pe-color-text-warning(already exists upstream)--color-danger-text:#b91c1cmatches the previous hardcoded value--color-success-text:#285e61matches--pe-color-primary-700(uppercase/lowercase hex equivalence)
- The
var()syntax with fallbacks is correct and will pick up the upstream tokens once design-system v0.5+ is installed - No other files reference these color variables directly, so the change is isolated to theme.css
- Comment clearly explains the migration strategy
The approach is sound: renders identically today, and will automatically pick up the upstream values when the design-system package is upgraded. No follow-up PR needed in this repo.
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.
Summary
Drops the inconsistency between policybench's locally-defined accessible text colors and the upstream
@policyengine/design-systemtokens.The recent a11y pass had to declare
--color-danger-textand--color-success-textlocally because the design system only exposed--pe-color-text-warning(no error or success companions). policyengine-app-v2#1024 adds those upstream as--pe-color-text-errorand--pe-color-text-success.This PR switches our theme.css to:
So:
Verification
bun run lintclean.bun run buildclean.🤖 Generated with Claude Code