Minimal role token adoption - #987
Draft
microbit-matt-hillsdon wants to merge 6 commits into
Draft
Conversation
Phase 3 of the focus-and-colour plan (ui-private docs/role-tokens.md). The library replaced its ad-hoc semantic tokens with property-namespaced roles, so this preset moves with them: statusBarBg becomes surface.statusBar, and the secondary-disabled variant reads button.secondary.border / .fg rather than the old flat keys. Value-preserving, measured: Panda's generated CSS resolved through every var() chain shows 0 changed declarations across 1568 selectors in the light context. The dark context picks up the library's new on-dark wash flips, which is what fixes `ghost` on the tagged ActionBar. dev:link-ui and dev:link-ui-patterns join the scripts — the first matching classroom and data-microbit-org, the second new to the family because the LanguageDialog pattern reads these tokens too.
Symlinks ../ml-trainer-microbit into node_modules, which is the switch both panda.config.ts and vite.config.ts test for, so one link moves the Panda codegen and the Vite alias together. Builds the theme package first — both resolve it through dist. dev:unlink-theme reverses it.
Moves the twelve link call sites onto `fg.link`, replacing the hardcoded brand.600 they each carried. No preset change: brand.600 is already the base preset's default, so this app was on the right value all along and simply said so twelve times. Value-preserving there: #2b6cb0 on the OSS build, #0071aa with the CreateAI preset, before and after. One visible change. The privacy policy link in NativeConsentDialog reads as ordinary body text — it sits mid-sentence inside a grey <Text> and inherits it, so nothing but the hover underline marks it as a link. That is original, not migration fallout: the element has carried `href` and no colour in all nine versions of the file, back to its first commit (dcbba7b). Chakra's Link base style was `color: "inherit"` and this app never themed Link, so it inherited under Chakra exactly as it did under Panda. It is now a link. Links that deliberately inherit are untouched: the GitHub icon links in the About dialog's version table take currentColor, and the buttons using `variant="link"` without an override were already on this token.
Panda accepts an unknown `semanticTokens` key silently — the override never applies and nothing fails, so a rename in @microbit/ui would leave this app on the library's colours with a green typecheck. Covers the private brand preset too, when it is linked. Checking it here rather than in its own repo keeps that repo free of a dependency on @microbit/ui, and runs the check where the merge actually happens.
Assert @microbit/ui's droppedConditionTokens alongside the existing
key check, for the app preset and (when linked) the brand preset: a
flat override of a { base, _onDark } token merges wholesale and
silently drops the dark-surface flip.
|
Preview build will be at |
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.
Lots of ramp references left for another pass but this restates the overrides in terms of role tokens and updates links.
Draft awaiting UI library release.