Skip to content

Rebrand: swap legacy $purple in .character-text for a semantic token - #74660

Draft
cnbrenci wants to merge 1 commit into
stagingfrom
claude/rebrand-skill-work-wplwbo
Draft

Rebrand: swap legacy $purple in .character-text for a semantic token#74660
cnbrenci wants to merge 1 commit into
stagingfrom
claude/rebrand-skill-work-wplwbo

Conversation

@cnbrenci

Copy link
Copy Markdown
Contributor

.character-text is the "classic dialogue" heading style used by instructions
markdown. Its color was pinned to shared/css/color.scss $purple (#8c52ba),
so it stayed legacy purple while the rest of the instructions panel rebranded -
the purple headings Moshe spotted in Star Wars.

This points it at the semantic token --text-brand-purple-primary instead. One
declaration changes; line-height and font-size are untouched.

What the token resolves to (measured in a browser, not guessed):

brand resolves to contrast on the white instructions panel
before ($purple) #8c52ba 5.21:1
current brand --brand-purple-50 #9657c7 4.68:1
[data-brand='codeai-next'] --text-brand-primary #4c42cf 7.03:1

So today it is a barely-perceptible tint shift, and after brand cutover the
heading follows the brand instead of freezing at the old hex - which is the
point of the ticket. All three values clear WCAG AA at this size (24px counts as
large text, 3:1; they clear the stricter 4.5:1 normal-text bar too).

Scope notes:

  • .character-text is defined exactly once in the repo, in
    apps/style/studio/style.scss, so this one line covers every surface that
    uses the class - not just Star Wars. The only in-repo markup using it is the
    HOC 2015 free-play instructions blob in apps/src/studio/levels.js; anything
    else comes from levelbuilder-authored markdown in the database, which picks up
    the same rule.
  • The sibling details.hoc2015 > p { color: $charcoal; } in the same block is
    deliberately left alone. $charcoal (#5b6770) has no exact DS primitive, so
    it is a judgment call rather than a mechanical swap and belongs in its own
    ticket.

Links

Testing story

Hey, human! Add screenshots here.

Before screenshot

After screenshot

The level Moshe reported, for an easy before/after:

Heads up on what I could and could not check. This container has no MySQL and no
locals.yml, so I could not boot dashboard and drive the real level. What I did
verify: the SCSS compiles to color: var(--text-brand-purple-primary), and a
headless Chromium loading colors.css + the compiled studio.css computes
rgb(150, 87, 199) on .character-text today and rgb(76, 66, 207) under
[data-brand='codeai-next'], with font-size and line-height unchanged. The var
chain resolves - but nobody has seen it in the actual instructions panel yet.
That part is on you:

  • Open the Star Wars level above and confirm the first instructions line is
    still a heading-sized purple, just a touch lighter than prod. Nothing else
    on the panel should move - same size, same line spacing, same wrapping.
  • Flip to the new brand (data-brand='codeai-next' on <html>) and confirm
    the heading turns CADS indigo rather than staying legacy purple. This is
    the behavior the ticket is actually asking for.
  • Check the same level at 1568 / 1280 / 1024 / 768 wide. Any horizontal
    scroll below the lab's min width is pre-existing - please don't chase it.
  • Try the above in Firefox and Safari.
  • If you can find another level whose instructions use character-text
    (levelbuilder markdown, not just Star Wars), spot-check one.
  • Screen reader: the heading is a styled <span> before and after, so
    nothing should change in the reading order - worth a quick confirm.
  • RTL: load the level in a RTL locale and confirm the heading still reads
    correctly (no layout involved in this change, but cheap to check).

Generated by Claude Code

.character-text is the "classic dialogue" heading style used by
instructions markdown (HOC 2015 Star Wars free-play, and any
levelbuilder markdown that reaches for the class). Its color was
pinned to shared/css/color.scss $purple (#8c52ba), so it stayed
legacy purple while the rest of the instructions panel rebranded.

Point it at --text-brand-purple-primary instead. Under the current
brand that resolves to --brand-purple-50 (#9657c7); under
[data-brand='codeai-next'] brandLegacyAliases.css collapses it onto
--text-brand-primary (#4c42cf), so the heading follows the brand
rather than freezing at the old hex.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NG1wL8tqLuPtJzaQSxLsDY
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.

2 participants