Skip to content

Commit ff2a366

Browse files
committed
feat(hub-ui): bridge json-render accent to the brand primary
json-render components read their accent from `--jr-primary` (a standalone blue default) via inline styles, so rendered plugin UI ignored the hub primary and any branding override. Since ViewJsonRender renders inside the dock shadow root, set `--jr-primary` from the brand primary in the ramp block — Tabs, Switch, Progress, and Link now follow --devframe-primary / branding, tracking the global primary (not per-group accent, matching the chrome-only accent decision). The blue fallback remains for standalone json-render use. Created with the help of an agent.
1 parent a1c74f9 commit ff2a366

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎packages/hub-ui/src/client/.generated/css.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎packages/hub-ui/src/client/json-render/components/tokens.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export const borderMuted = 'var(--jr-border, rgba(128,128,128,0.08))'
1010
export const borderInput = 'var(--jr-border, rgba(128,128,128,0.3))'
1111
// Interactive-hover border (Card) — a clearer step up than borderInput, without going full `primary`.
1212
const borderStrong = 'var(--jr-border, rgba(128,128,128,0.5))'
13-
// Keep in sync with the devframe design primary (design/uno.config.ts).
13+
// Accent for json-render content. `--jr-primary` is bridged to the brand
14+
// primary in `primary-ramp.css` (so rendered plugin UI follows `--devframe-primary`
15+
// / branding); the blue fallback only applies when json-render is used
16+
// standalone, outside the dock's shadow root.
1417
export const primary = 'var(--jr-primary, #6b84fd)'
1518
export const bg = 'var(--jr-bg, inherit)'
1619

‎packages/hub-ui/src/client/primary-ramp.css‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,15 @@
3838
--colors-primary-500: var(--devframe-primary-500, #578861);
3939
--colors-primary-400: var(--devframe-primary-400, #75a67e);
4040
--colors-primary-300: var(--devframe-primary-300, #93c69d);
41+
42+
/*
43+
* Bridge the json-render subsystem's accent token to the brand primary.
44+
* json-render components (Tabs/Switch/Progress/Link, …) read their accent
45+
* from `--jr-primary` (default a standalone blue) via inline styles; because
46+
* `ViewJsonRender` renders inside this shadow root, setting it here makes all
47+
* rendered plugin content follow `--devframe-primary` / branding. It tracks
48+
* the global primary, not per-group accent (the plugin view is intentionally
49+
* left out of the group-accent scope).
50+
*/
51+
--jr-primary: var(--colors-primary-DEFAULT, #3a6a45);
4152
}

0 commit comments

Comments
 (0)