Skip to content

Add primaryTextColor, a separate color for brand-colored text - #682

Draft
n400 wants to merge 1 commit into
summer/dark-primary-colorfrom
summer/primary-text-color
Draft

n400 wants to merge 1 commit into
summer/dark-primary-colorfrom
summer/primary-text-color

Conversation

@n400

@n400 n400 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Overview

Part of #681. Adds an optional primaryTextColor to Layout, BlankView, NewBadgeView, and NewPointsView. It sets --mdhui-color-primary-text, so it colors links and other text only; buttons, charts, and progress bars keep primaryColor. Each mode uses it only when that mode's value is set, otherwise text falls back to primaryColor, so views without it look exactly as they do with #680. This lets a view pass contrast in dark mode, where one brand color can't work both as a button fill under white text and as text on a dark card.

Stacked on #680; the base will move to main once that merges.

Security

  • I have ensured no secure credentials or sensitive information remain in code, metadata, comments, etc.
    • .storybook/preview.js is untouched.
    • There are no temporary testing changes.
  • These changes do not introduce any security risks: CSS custom properties change value.

Testing

  • This change requires additional testing in the MDH iOS/Android/Web apps. (Create a pre-release tag/build and test in a ViewBuilder PR.)

Unit tests in __tests__/components/presentational/Layout/Layout.test.tsx cover the text color set in both modes, set for one mode only, set without a brand, invalid or null, and not set. End to end: the ViewBuilder PR adds a picker for it.

Documentation

  • This change does not impact documentation or Storybook.

Layout, BlankView, NewBadgeView, and NewPointsView take an optional primaryTextColor. It colors links and other text only; buttons, charts, and progress bars keep primaryColor. Each mode uses it only when that mode's value is set, otherwise text falls back to primaryColor, so views without it look the same as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant