Rebrand: text compression widget colors (SL-2116) - #74659
Draft
cnbrenci wants to merge 1 commit into
Draft
Conversation
Swap the widget's legacy purple and the write-your-own dialog's orange
button for design-system tokens.
The two column headers ("Compressed:" / "Dictionary:") were painted with a
hardcoded #8c52ba, the legacy brand purple. They now use
--background-brand-purple-primary, which resolves to #9657c7 under the
current brand and remaps to the CADS brand ramp under data-brand=codeai-next
(see brandLegacyAliases.css) -- a hardcoded hex would not rebrand.
The dialog opened by "Write your own" builds plain <button> elements, so its
Add and Cancel buttons picked up the global #continue-button (orange) and
#again-button (green) fills from application.scss. Those globals are shared
with feedback dialogs site-wide, so rather than repaint them, the widget now
overrides them for its own dialog only. Two IDs outrank the one-ID globals,
so this wins on specificity rather than stylesheet load order. The fills
match LegacyButton's already-rebranded primary and cancel types.
Both buttons were well below WCAG AA before: white on orange measured
1.99:1 and white on green 2.00:1. They now measure 4.68:1 and 13.51:1.
Jira: SL-2116
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WuW62X15wMpesGHr3wiQFV
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.
Swaps the text compression widget's legacy purple and its dialog's orange button for design-system tokens. Two files' worth of ticket, one file's worth of diff: everything lives in the widget's own
<style>block.The purple. The two column headers ("Compressed:" / "Dictionary:") were painted with a hardcoded
#8c52ba-- legacy brand purple. They now use--background-brand-purple-primary, which resolves to#9657c7today and remaps to the CADS brand ramp underdata-brand='codeai-next'(seebrandLegacyAliases.css:71). A hardcoded#9657c7would have looked right now and quietly failed to rebrand later.The orange button. "Write your own" opens a
LegacyDialogwhose body is a raw HTML string, so its Add and Cancel buttons are bare<button>elements. They were picking up the global#continue-button(orange,$orange) and#again-button(green,$green) fills fromapplication.scss:3660-3672. Those globals are shared with feedback dialogs, version history and submit flows site-wide, so repainting them there would have been a much bigger blast radius than this ticket. Instead the widget overrides them for its own dialog only. Two IDs outrank the one-ID globals, so this wins on specificity, not stylesheet load order -- verified by deliberately loading the globals after the widget's rules and confirming the widget still wins. The new fills matchLegacyButton's already-rebrandedprimaryandcanceltypes, so the dialog matches other rebranded legacy dialogs.Note the ticket only named the orange Add button. I did the green Cancel button in the same dialog too -- leaving a chartreuse Cancel next to a brand-purple Add would have looked half-finished, and
LegacyButtonalready pairs those two treatments. Shout if you'd rather I split it.Accessibility
Both dialog buttons were well below WCAG AA before. Measured, not eyeballed:
The header drops slightly because brand purple is a touch lighter than the legacy one; it still clears AA for normal text.
Links
Testing story
Hey, human! Add screenshots here.
Before screenshot
After screenshot
The widget renders at
/s/text-compression/lessons/1/levels/1(short standalone course, only two levels -- the other one is the Aloe Blacc video). Prod for comparison: https://studio.code.org/s/text-compression/lessons/1/levels/1 . Local needs this branch plususe_my_apps: true.Then, make sure you manually test the following:
?locale=ar-SAand confirm the header bars and dialog buttons still lay out sanely.Make sure you ask Emily (she filed the ticket):
--borders-neutral-strong,#b7c1cb) is only 1.83:1 against the white dialog, under the 3:1 WCAG 1.4.11 asks for a UI component boundary. I matchedLegacyButton'scanceltype rather than deviating here, so this is really a design-system-wide question -- but this PR is where it becomes visible. Is a darker border token wanted, here or inLegacyButton?#000bg,#0c0/#c00figures), the yellowmarkhighlight and matching CodeMirror gutter (#ff9), and the dictionary error line (#f99). I left them alone -- the terminal look is deliberate and there's no obvious semantic token for it. Do you want those rebranded in a follow-up, or are they fine as-is?Generated by Claude Code