feat(hub-ui): overridable primary color + customizable branding - #177
Open
antfubot wants to merge 2 commits into
Open
feat(hub-ui): overridable primary color + customizable branding#177antfubot wants to merge 2 commits into
antfubot wants to merge 2 commits into
Conversation
Make the reference dock's identity a first-class, overridable surface so a
consumer (e.g. a Vite DevTools-style viewer) can reuse hub-ui and rebrand it —
logo, product name, and color — without forking.
Primary color
- The whole primary ramp derives from a single `--devframe-primary` variable
(src/client/primary-ramp.css), appended after the UnoCSS output so it wins
over Wind4's `:host` defaults. Unset keeps the exact devframe green (via a
guaranteed-invalid fallback); set derives the five stops with `color-mix`.
- The dock glow follows the primary variable, so a rebrand retints it too.
Group accent
- A group's `accentColor` is applied by overriding `--devframe-primary` on the
group's chrome container (`.devframes-accent-scope`), retinting the whole
cluster through the primary token — replacing the bespoke inline accent
colors. The group's plugin view is left untouched.
Branding
- New `DevframeBranding` (logo/wordmark with light/dark variants, productName,
primaryColor, tagline, favicon, windowTitle); all optional with devframe
defaults. `createUi({ branding })` publishes it as `branding.json` through a
new generic `DevframeHubUi.assets` seam on `@devframes/hub` (the only hub
change — branding-agnostic). The dock fetches it before first paint; a host
page can override any field at runtime via `window.__DEVFRAME_BRANDING__`,
`<script data-*>`, or `?query` params, merged per field.
- Logo swaps at every BrandMark/BrandWordmark site; productName templatizes all
user-visible copy; favicon/title apply to the standalone viewer and popped-out
window only (never the embedded host page's head).
Created with the help of an agent.
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.
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.
Makes the reference dock's identity a first-class, overridable surface: a consumer (e.g. a Vite DevTools-style viewer) can reuse hub-ui and rebrand it — logo, product name, and color — without forking.
Primary color as one variable
--devframe-primary(src/client/primary-ramp.css), appended after the UnoCSS output so it wins over Wind4's:hostdefaults. Unset → exact devframe green (guaranteed-invalid fallback trick); set → the five stops derive viacolor-mix. Everything already routes throughvar(--colors-primary-*), so it all retints.Group accent, unified
accentColoris applied by overriding--devframe-primaryon the group's chrome container (.devframes-accent-scopere-runs the ramp so the override actually cascades), retinting the whole cluster through the primary token — replacing the bespoke inline accent colors inaccent-color.ts. The group's plugin view is left untouched (no surprise recoloring of third-party UI).Branding
DevframeBranding:productName,logo/wordmark(string | { light, dark }),primaryColor,tagline,favicon,windowTitle— all optional with devframe defaults.createUi({ branding })publishes it asbranding.jsonvia a new genericDevframeHubUi.assetsseam on@devframes/hub— the only hub change, and it carries no branding knowledge. The dock fetches it before first paint (no flash). A host page overrides any field at runtime viawindow.__DEVFRAME_BRANDING__,<script data-*>, or?queryparams — merged per field (host page wins).BrandMark/BrandWordmarksite (incl. thebuiltin:devframessentinel);productNametemplatizes all user-visible copy;favicon/windowTitleapply to the standalone viewer and popped-out window only — the embedded bootstrap never touches the host page's head.Internal
devframes-*ids, custom-element tags, storage keys, and command ids are unchanged.Design record
Shaped through a full decision interview: primary-as-variable, ramp via
color-mix, group accent unified through the variable, branding delivered viacreateUi+ host-page overrides, and a minimal genericassetsseam as the single agreed hub change.Verification
build:css,typecheck(workspace-wide),build(embedded + standalone),lint,knip,build-storybook, and thetsnapiAPI snapshots all pass. A Brand → Branded story demonstrates a custom name/logo/primary. No Chromium on this ARM64 host, so visual checks are via the Storybook/build pipeline rather than screenshots.Created with the help of an agent.