Skip to content

Use the green token instead of a hardcoded hex on product pages - #3847

Open
ChristopherChudzicki wants to merge 2 commits into
mainfrom
cc/13051-theme-green
Open

Use the green token instead of a hardcoded hex on product pages#3847
ChristopherChudzicki wants to merge 2 commits into
mainfrom
cc/13051-theme-green

Conversation

@ChristopherChudzicki

@ChristopherChudzicki ChristopherChudzicki commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

https://github.com/mitodl/hq/issues/13051 — Learn half. Smoot side: mitodl/smoot-design#255

Description (What does it do?)

Now that smoot's green token is #008000, the two product-page spots that hardcoded that hex can use the token instead. Also pins @mitodl/smoot-design to the pre-release off #255 so the swap is visible in review.

  • CertificateTrackCard.tsx: the approved financial-aid link. Drops APPROVED_GREEN and the comment paragraph that justified it, and reads the token off the styled callback's theme.
  • ProgramSavingsBlock.tsx: the "Save $X" text.
  • frontends/{main,ol-components}/package.json + yarn.lock: 6.33.10.0.0-cf492ea.

Two things worth knowing before merging:

  1. The pin must change. 0.0.0-cf492ea is a pre-release. Re-pin to the semantic release once Disallow blank values in some LearningResource auxillary model fields: #255 merges. It also carries everything between 6.33.1 and smoot main, not just the green.
  2. The visible change isn't in the files I touched — those two spots were already #008000 and look identical after. What darkens is everywhere Learn already used the token: TrackCard, WhatYoullLearnSection checkmarks, ReceiptOrderSummary, CourseEnrollmentDialog, ContractAdminPage / RowActionMenu, plus Alert success and the feedback drawer 👍 from smoot itself.

Screenshots (if appropriate):

example before/after:

Screenshot 2026-08-27 at 10 50 53 AM

How can this be tested?

Don't bother. But if you really want to:

Product pages are the densest place to see it. On a course page with financial aid available and a program page with a savings line:

  1. Certificate track card — the "Approved" financial-aid link and the "Save $X" text read as a slightly deeper green, and still match each other.
  2. What you'll learn — the bullet checkmarks pick up the same green.
  3. Enrollment dialog / receipt page — success text and the confirmed-enrollment state darken too.

Nothing should look different in kind anywhere — no washed-out or mismatched greens, and no green next to a different green.

yarn typecheck and yarn lint-check pass; main (209 suites / 2659 tests) and ol-components (22 / 193) pass against the pre-release.

Copilot AI balanced review requested due to automatic review settings August 27, 2026 15:58
@ChristopherChudzicki
ChristopherChudzicki requested a review from a team as a code owner August 27, 2026 15:58
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copilot AI 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.

Pull request overview

Replaces hardcoded green values with the shared design token and temporarily updates smoot-design.

Changes:

  • Uses theme.custom.colors.green for savings and financial-aid text.
  • Pins smoot-design to a prerelease requiring replacement before merge.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CertificateTrackCard.tsx Uses the green theme token.
ProgramSavingsBlock.tsx Uses the green theme token.
frontends/main/package.json Pins the prerelease dependency.
frontends/ol-components/package.json Updates the peer dependency.
yarn.lock Locks the prerelease version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontends/main/package.json Outdated
"@mitodl/hacksnack": "^0.1.2",
"@mitodl/mitxonline-api-axios": "2026.8.18",
"@mitodl/smoot-design": "6.33.1",
"@mitodl/smoot-design": "0.0.0-cf492ea",
Comment thread frontends/ol-components/package.json Outdated
},
"peerDependencies": {
"@mitodl/smoot-design": "6.33.1",
"@mitodl/smoot-design": "0.0.0-cf492ea",
@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Aug 27, 2026

@daniellefrappier18 daniellefrappier18 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.

LGTM

ChristopherChudzicki and others added 2 commits August 28, 2026 16:48
Two product-page spots hardcoded #008000 because the `green` token was
#00AD00, which fails WCAG AA as text on a white card. smoot-design now
ships #008000 as `green`, so both can use the token:

- `CertificateTrackCard`: the approved financial-aid link. Drops the
  APPROVED_GREEN constant and reads the token off the styled callback's
  theme, along with the comment paragraph that justified the raw hex.
- `ProgramSavingsBlock`: the "Save $X" text.

Part of mitodl/hq#13051.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
6.33.4 is the first release carrying the green token change from
mitodl/smoot-design#255 (#00AD00 -> #008000), which the product-page
checkmarks read via theme.custom.colors.green.

Note this also carries everything else between 6.33.1 and 6.33.4.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants