Namespace the subtree theme scopes as .theme-light/.theme-dark: dark: follows the nearest scope, portalled dashboard menus and tooltips restate it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 17:42:59 +02:00
co-authored by Claude Opus 5.5
parent 58b92da8b0
commit 868a10d94b
14 changed files with 78 additions and 47 deletions
+2 -3
View File
@@ -219,9 +219,8 @@ function BrainCanvas() {
nodesConnectable={false}
elementsSelectable={false}
proOptions={{ hideAttribution: true }}
// React Flow stamps this on the wrapper as a class, and the app's own
// token scopes are named `.light` / `.dark` (index.css) — so leaving it
// unset re-themes the whole canvas to light inside a dark shell.
// React Flow's own defaults, for whatever flow.css does not route
// through the tokens, follow the theme too.
colorMode={resolvedTheme}
fitView
fitViewOptions={FIT}
+2 -3
View File
@@ -1284,9 +1284,8 @@ function FlowEditorInner({
nodeTypes={nodeTypes}
edgeTypes={edgeTypes}
proOptions={{ hideAttribution: true }}
// React Flow stamps this on the wrapper as a class, and the app's own
// token scopes are named `.light` / `.dark` (index.css) — so leaving it
// unset re-themes the whole canvas to light inside a dark shell.
// React Flow's own defaults, for whatever flow.css does not route
// through the tokens, follow the theme too.
colorMode={resolvedTheme}
fitView
fitViewOptions={FIT_VIEW}
+4 -4
View File
@@ -2,10 +2,10 @@
* React Flow, routed through the design tokens.
*
* Scoped to `.react-flow` rather than added to index.css, so the canvas needs no
* tokens of its own. The `colorMode` prop is passed all the same: React Flow
* stamps it on the wrapper as a class, and `.light` / `.dark` are the app's own
* token scopes — an unset one defaults to `light` and re-themes the whole canvas
* inside a dark shell. See the root DESIGN-GUIDELINES.md → Shells.
* tokens of its own. The `colorMode` prop is passed all the same, so React
* Flow's own defaults for anything not routed here follow the theme. The class
* it stamps on the wrapper cannot re-theme the canvas: the app's token scopes
* are `:root.dark` and `.theme-light` / `.theme-dark` (index.css).
*/
.react-flow {