feat(brand): add --shadow-overlay, the theme-inverting lift for covering surfaces - #90
Conversation
🦋 Changeset detectedLatest commit: 8be0e7d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🤖 AI Code Review (ensemble)
SummaryThe PR adds a Issues Found2 total — 1 P1 (blocking) · 0 P2 (should fix) · 1 P3 (nice to have)
.light block content |
🤖 AI Code Review (ensemble)SummaryThe PR introduces a No Issues Found✅ APPROVEThe changes are functionally sound, well-reasoned, and include excellent guardrails. The new Synthesized by Sokuza AI from multiple independent reviewers |
Problem
@tangle-network/agent-appships React surfaces that reach for a--shadow-overlaytoken —AssistantDock(the floating dock and its drawer) andweb-react's exportedOVERLAY_SHADOWconstant. That token is defined only in agent-app's owntheme/tokens.css, and the apps that render those components do not import that stylesheet: they compose the design system through@tangle-network/sandbox-ui/globals.css, which re-ships brand's tokens.The result is that the assistant dock renders with no elevation at all in
products/platform/web(14 imports ofagent-app/assistant) andproducts/sandbox/web(3). A drawer that covers the page reads as flat against it.There are two failure modes behind that, not one.
shadow-[var(--shadow-overlay)]resolves to nothing because the variable is undefined, and the bareshadow-overlayutility does not exist at all, because those apps do not consume agent-app's Tailwind preset.Solution
Add
--shadow-overlayto brand: the elevation step above--shadow-dropdown, for a surface that covers the page rather than sitting beside it — a drawer, a modal, a floating dock. Two layers, a tight contact shadow plus a wide ambient one.It is declared in
tokens.cssand in the@themeblock, so Tailwind emits ashadow-overlayutility as well as the variable. That closes both failure modes with one token.Alone among brand's shadows it derives from
--hsl-foregroundrather than a fixedrgba, so it inverts with the theme. That is what makes it work in dark, where a black shadow on a dark canvas renders as nothing — the same observation already recorded at the top oftokens.css. Because the ramp does the inverting, one declaration serves both themes and the light block does not restate it:rgba(227, 230, 237, 0.1)/0.16— a soft halorgba(43, 44, 62, 0.1)/0.16— dark inkThe alpha pair was chosen by rendering three candidates against brand's own surfaces rather than porting agent-app's numbers, which are tuned to a different ramp. The conservative candidate barely separated the drawer from the page; the strong one read as a glow rather than elevation.
Validation
sandbox-uiagainst this change (itsvalidate-built-cssgates pass) sodist/globals.csscarries the token, rebuiltproducts/platform/webagainst that, and confirmed the built app stylesheet contains--shadow-overlay: 0 2px 6px hsl(var(--hsl-foreground) / .1), 0 16px 40px hsl(var(--hsl-foreground) / .16)AssistantDock's literal class strings against that built stylesheet, before and after, in both themes: the drawer edge gains a halo in dark and a soft lift in lightNote for whoever picks up the rollout:
sandbox-ui/dist/globals.cssinlines brand's tokens at build time, so this reaches apps only after sandbox-ui rebuilds and publishes against the released brand.