Repository navigation
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the described token behavior and is adequately covered by focused tests.
0 open findings
What changed in this PR
Updates dark-mode brand styling so explicit dark brand colors also drive chart and progress marks while text remains scheme-colored.
Changes:
- Adds conditional dark-mode
primary-markstyling. - Expands Layout token tests across color configurations.
| File | Description |
|---|---|
src/components/presentational/Layout/Layout.tsx |
Applies explicit dark brand colors to marks. |
__tests__/components/presentational/Layout/Layout.test.tsx |
Verifies fill, mark, and text token behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I'm sure there's a way to manage backwards compatibility here (e.g. by having a separate text color you can set); for now we could make the behavior the same and then add that override separately in view builder? |
|
yes, i would really like to add some warnings/notes in the ui to alert the user to the color accessibility reqs, but i didnt want to increase scope too much. editing this pr to add the text tokens for backwards compatibility and will then introduce a new pr |
In 4.3.0 the brand only set the fill token in dark, so links, charts, and progress bars in a branded view fell back to the scheme's blue. The brand drives the fill and text tokens in both schemes again, as it did in 4.2.2. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
26f6589 to
76805a4
Compare
|
per Chris's feedback, I changed this so the brand drives text and marks in dark mode too, which puts it back to how 4.2.2 behaved. One color still can't pass contrast as both a primary button fill and as text on a dark card, so the plan is a separate dark text color with a picker in ViewBuilder and contrast warnings in the UI: #681. |

Overview
Follow-up to #657. In dark mode, a view's primary color only set
--mdhui-color-primary, the fill token. Charts, progress bars, and goal rings read-mark, so in a view with its own dark primary color they fell back to the scheme's blue (reported on CareEvolution/MyDataHelpsViewBuilder#650). When the brand has adarkModevalue, Layout now sets-markfrom it in dark as well. A plain-string brand or a light-only object reused in dark still drives fills only.Links and other
-textuses stay on the scheme's blue in dark, on purpose. No one dark value works for both duties: a color that carries white text on a button needs a luminance of 0.183 or less, and a color readable as small text on the dark card needs 0.256 or more. The pink#E91E63from the ViewBuilder report is 4.35:1 under white text and 3.55:1 on the card, so it passes the 3:1 mark floor and fails the 4.5:1 text floor. If we want brand-colored links in dark, that is a second color: aprimaryTextColorprop here and a picker for it in ViewBuilder.Security
Testing
Any story wrapped in Layout, dark scheme, with a
primaryColorof{ lightMode: X, darkMode: Y }: chart lines, progress bars, and goal rings take Y; buttons take Y; links stay blue. With a plain string or{ lightMode: X }: buttons take X, charts and links stay blue. Light mode is unchanged. Unit tests in__tests__/components/presentational/Layout/Layout.test.tsxcover the five cases.Documentation