[rebrand] Migrate blockly workspace to design-system semantic tokens#73785
Merged
Conversation
Per design guidance on the Sprite Lab rebrand: the shared workspace chrome (dark "Blocks / Workspace" pane header, Blockly toolbox sidebar background, and Blockly toolbox category text) is hard-coded to legacy neutral values and will visibly stick out once the rebrand ships new neutral colors. Migrate these three surfaces to semantic tokens so they follow the rebrand automatically. Changes: - apps/src/common-styles.module.scss: .darkHeader and .darkHeaderUnfocused swap $neutral_dark -> var(--background-neutral-primary-inverse), $neutral_white -> var(--text-neutral-white-fixed). The button-span dark text in the unfocused state uses --text-neutral-primary. - apps/src/blockly/addons/cdoCss.ts: add !important rules for .blocklyToolbox background and .blocklyToolboxCategoryLabel color, so the semantic tokens override Blockly's default stylesheet and the body-level inherited color. - apps/src/p5lab/AnimationTab/ListItemThumbnail.jsx: swap the raw backgroundColor: 'white' to var(--background-neutral-white-fixed). Not touched: block colors themselves (per design's "avoid the blocky area for now"), Blockly workspace SVG background (it uses a grid pattern fill, not a solid color - separate follow-up), and cdoTheme.js's legacy toolboxBackgroundColour: '#DDDDDD' (the CSS override wins via specificity + !important, keeping this diff tighter). Blast radius: every Blockly-using lab in the repo (Sprite/Game/App/Web/ Dance/Studio/Maze/Turtle/Flappy/Bounce/Craft/Music/Jigsaw/Java/Python). Cross-lab QA sweep required. Verified live via pink-test theme: dark header renders --neutral-black inverse (deep magenta in pink theme), toolbox background resolves to --background-neutral-tertiary (light pink), category labels to --text-neutral-primary (hot pink). Semantic wiring proven; the rebrand sweep will pick up whatever the neutral tokens become. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Per design guidance, the Settings / Version History / Show Code header buttons (which live inside the .darkHeader dark bar migrated in the prior commit) were still hardcoded to legacy $neutral_dark / $neutral_white / $neutral_dark10 / $light_gray / $white / $purple. Migrate .headerButton (the current button style) to semantic tokens: - color/bg default -> --text-neutral-primary / --background-neutral-primary - hover bg -> --background-neutral-tertiary (was $neutral_dark10 #EAECEF, new resolves to #eaeef2 in default - near-exact hex match) - :disabled + &Disabled bg -> --background-neutral-disabled (was $light_gray #949ca2, new resolves to #d4dae1 in default - visibly lighter, semantic role matches). Design ask if the lighter disabled state is acceptable. - span color -> --text-neutral-primary - &Unfocused bg -> --background-neutral-primary - &Pressed: bg -> --background-neutral-white-fixed, color -> --text-brand-purple-primary, hover color -> --text-neutral-white-fixed Deliberately left alone: - .headerButtonMinecraft (intentional Minecraft-lab aesthetic with #606060 / #bfbfbf hardcoded values, not generic neutrals) - .legacyHeaderButton (marked with TODO for removal, Javalab-only) Verified in pink-test: Settings / Version History / Show Code buttons all resolve to --background-neutral-primary (#fff8fc light pink) with --text-neutral-primary (#d63384 pink). Semantic wiring proven. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The Blockly flyout panel (opens when a toolbox category is selected, shows the actual draggable blocks) was still filled with Blockly's legacy #DDDDDD default. Matches the same visual weight as the toolbox sidebar today, so use the same --background-neutral-tertiary token for both surfaces to keep them visually paired through the rebrand. .blocklyFlyoutBackground is an SVG rect where Blockly sets the fill as an attribute; a CSS fill: var(...) rule wins here with !important, same pattern as the .blocklyToolbox override. Verified live via pink-test: fill resolves to #ffe0ef (--background- neutral-tertiary in pink theme), consistent with the toolbox background. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two more shared Blockly chrome surfaces still on legacy hex under the pink-test audit: - .blocklyScrollbarHandle: fill was Blockly-default #cccccc (mid-light gray). Mapped to var(--background-neutral-quinary) which resolves to #c6ced6 in default theme (near-exact hex match; the closest DS neutral primitive to the legacy value). - .blocklyDropDownDiv: bg was white, border was #dadce0 (Blockly-default popup shown for field dropdowns like variable pickers). Mapped bg to var(--background-neutral-primary) (exact white in default) and border to var(--borders-neutral-primary) (#d4dae1 in default, very close to legacy #dadce0). Both use !important to override Blockly's default stylesheet (same pattern as the .blocklyToolbox / .blocklyFlyoutBackground overrides earlier in this PR). Verified live in pink-test: - scrollbar handle: fill rgb(255, 179, 220) = --background-neutral-quinary - dropdown bg: rgb(255, 248, 252) = --background-neutral-primary - dropdown border: rgb(255, 214, 236) = --borders-neutral-primary Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
alex-m-brown
marked this pull request as ready for review
July 13, 2026 20:55
fisher-alice
approved these changes
Jul 14, 2026
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.
Migrate the shared workspace chrome that renders around Blockly in every Blockly-using lab to design-system semantic tokens - so once the rebrand shifts the neutral palette, these surfaces follow instead of sticking out at legacy values. Also folds in a tiny stray raw-white cleanup in Sprite Lab's
ListItemThumbnail.Scope: four files. Only color values change. Block styles themselves are untouched
.darkHeader/.darkHeaderUnfocusedbg$neutral_dark(#292F36)var(--background-neutral-primary-inverse).darkHeader/.darkHeaderUnfocusedcolor$neutral_white(#FFFFFF)var(--text-neutral-white-fixed).darkHeaderUnfocused button spancolor$neutral_dark(#292F36)var(--text-neutral-primary).headerButton(Settings / Version History / Show Code) color$neutral_dark(#292F36)var(--text-neutral-primary).headerButtonbg$neutral_white(#FFFFFF)var(--background-neutral-primary).headerButton:hoverbg$neutral_dark10(#EAECEF)var(--background-neutral-tertiary)#eaeef2).headerButton:disabledbg$light_gray(#949ca2)var(--background-neutral-disabled)#d4dae1, visibly lighter).headerButtonPressedbg / color$white/$purplevar(--background-neutral-white-fixed)/var(--text-brand-purple-primary).blocklyToolboxsidebar bg#DDDDDD(fromcdoTheme.js)var(--background-neutral-tertiary).blocklyToolboxCategoryLabel(category text)#333inherited frombodyvar(--text-neutral-primary)(#292F36).blocklyFlyoutBackground(flyout panel fill)#DDDDDDvar(--background-neutral-tertiary).blocklyScrollbarHandlefill#ccccccvar(--background-neutral-quinary)(#c6ced6).blocklyDropDownDivbgvar(--background-neutral-primary).blocklyDropDownDivborder#dadce0var(--borders-neutral-primary)(#d4dae1)ListItemThumbnail.jsx:14root bg'white'var(--background-neutral-white-fixed)Not touched (deliberate):
.blocklyMainBackground(workspace SVG grid pattern) - fills via<pattern>cells, not a solid color; needs a deeper grid-cell change - follow-up chip.headerButtonMinecraftvariants (#606060/#bfbfbf) - intentional Minecraft aesthetic, not generic neutrals.legacyHeaderButton(marked TODO for removal, Javalab-only)cdoTheme.js'stoolboxBackgroundColour: '#DDDDDD'(the.blocklyToolboxCSS override wins via!important)rgba(255,255,255,0.2)translucent overlay - adapts to any bg)Why
!importanton the Blockly overrides:.blocklyToolbox,.blocklyToolboxCategoryLabel,.blocklyFlyoutBackground,.blocklyScrollbarHandle, and.blocklyDropDownDivare styled by Blockly's own default stylesheet (and for the category label,body { color: #333 }fromapplication.css). Without!important, our rules lose to specificity/inheritance. Same pattern as the existingcdoCss.tsrules.Blast radius: every Blockly-using lab in the repo - Sprite Lab, Game Lab, App Lab, Web Lab, Dance, Studio, Maze, Turtle, Flappy, Bounce, Craft, Music, Jigsaw, Java Lab, Python Lab.
.darkHeaderand.headerButtonrender on the pane header in most of these; the Blockly toolbox / flyout / scrollbar / dropdown overrides apply wherever Blockly is injected.Links
Testing story
Before / After (default theme) — pane header, header buttons, sidebar, category text, flyout panel, workspace scrollbar, and field dropdown popup should look visually close to staging. Sidebar bg shifts about two shades lighter (
#DDDDDD→#eaeef2); the disabled header-button bg goes noticeably lighter (#949ca2→#d4dae1); everything else is near-exact hex.Manual QA — please walk through:
Pane header + header buttons
?brand=codeai-next.?brand=codeai-next.--background-neutral-disabled(#d4dae1in default, was#949ca2). Design ask if the lighter disabled state is acceptable.Blockly toolbox + flyout
--background-neutral-tertiary).Blockly workspace chrome
#c6ced6, was#cccccc), pink under?brand=codeai-next.make new sprite atblock). Popup bg: white in default, light pink in pink test. Border: subtle light gray in default, pink in pink test.Sprite Lab Costumes / Backgrounds
ListItemThumbnailroot uses--background-neutral-white-fixed).Cross-lab spot check
Browsers + a11y
Make sure you ask @moshebaricdo :
#DDDDDDto--background-neutral-tertiary(#eaeef2in default). About two shades lighter. Fine, or swap to--background-neutral-secondary(even lighter), or drop to primitive--neutral-gray-20(#d4dae1, closer to legacy)?#949ca2(mid gray) to--background-neutral-disabled(#d4dae1, visibly lighter). OK as the semantic value, or should we pick a darker disabled token?#dadce0to--borders-neutral-primary(#d4dae1). Practically indistinguishable — flagging for completeness.#333to--text-neutral-primary(#292F36). Barely visible — both are near-black.