Repository navigation
Replies: 2 comments
|
For transparency: this issue was prepared with AI assistance (Claude). The counts come from a script run over the three stylesheets, and any PR will be marked AI-assisted as CONTRIBUTING asks. |
|
OpenMAIC automated triage Feature request: make the workbench accent deployment-themeable instead of requiring downstream overrides of individual rules. The issue identifies 56 violet literals across `workspace-shell.css`, `composer-input.css`, and `course-end.css`; proposes deriving `--ws-accent-thread` and `--ws-accent-wash` from the base accent, adding role tokens for the fixed fill and remaining scale steps, sharing tokens with the composer and course-end styles, and adding a regression test. Source at checkout `ae5fd30` confirms the `.ws-root` light/dark accent tokens and matching literals in all three files, although the reporter's counts were from `a17795c3`, so line details may differ. This is a design/UI change requiring a maintainer decision on token names and whether the tokens remain on `.ws-root` or move to `:root`; CONTRIBUTING directs design/UI changes to a Discussion. Suggested next step: maintainer-review.
AI-generated assessment from the issue, discussion and source. No reproduction was executed; maintainers decide the next action. |
Uh oh!
There was an error while loading. Please reload this page.
Problem or Motivation
A deployment can already make the workbench its own without editing it.
BrandProvidertakes a name, a logo and a mark, and the shell's extension slots take pages and account entries; the header oflib/workbench/shell-extensions.tsxsays a deployment "adds them here instead of editing the shell". The accent color is the one part that cannot follow.The shell has tokens for it.
components/workbench/workspace-shell.cssdeclares--ws-accent("violet-600, the product's accent"),--ws-accent-threadand--ws-accent-wash, for light and for dark, and reads them 63 times. But the same violet is also written out as a literal color, outside those declarations:components/workbench/workspace-shell.csscomponents/workbench/composer-input.csscomponents/classroom/course-end/course-end.css--ce-*So a deployment that sets
--ws-accentgets a shell that is partly its color and partly violet. The canvas glow, the hover states of the rail and the header, the sign-in and tour buttons, the avatar, the composer's border and its chips all stay violet. Two details add to it:--ws-accent-threadand--ws-accent-washrepeat the color asrgba()literals instead of deriving from--ws-accent, so all three have to be overridden, once per mode.course-end.cssdoes not read the shell's tokens.--ce-accentholds the same two values as--ws-accent.I maintain a downstream edition, ZHEXU, which keeps its changes in an extension layer and edits two upstream files. For the accent we could not stay outside: a script finds each of these declarations and repeats it under our scope, which comes to 70 color values in 61 declarations. It has to be re-run after every merge from upstream, and it has to out-rank upstream's selectors, the
.darkones included. It works, but it is the kind of patching the extension slots exist to avoid.Proposed Solution
Have the accent in these three stylesheets come from tokens only. Each step below leaves upstream looking exactly as it does today.
--ws-accentwhere the literal already is that token's color for the mode the rule applies to. That is 15 of the 43 inworkspace-shell.css:var(--ws-accent), orcolor-mix(in srgb, var(--ws-accent) N%, transparent)for the same color at an opacity. The file already usescolor-mix(in srgb, …)for--composer-placeholder.--ws-accent-threadand--ws-accent-washcan be derived the same way. I checked in Chromium that these compute to the same color and opacity as the literals they replace..ws-page-btn-primary, .dark .ws-page-btn-primary,.ws-account-signin,.ws-tour-btn-primary) and in a few hover states and shadows that have no dark rule.--ws-accentcannot stand in for it: it becomes violet-400 in dark mode, where white text on it would drop from 5.7:1 to 2.7:1.#6d28d9), the gradient partner (#8b5cf6), the soft fills (#f3f0ff,#f6f3ff) and the soft borders (#ddd6ff,#cfc5ff).composer-input.cssis imported fromapp/globals.cssand is not scoped to.ws-root, so it needs either today's value as a fallback, as it already does for--composer-placeholder, or the tokens on:root. Incourse-end.css,--ce-accentcan read--ws-accent, with today's value as the fallback.Two questions before any code: what would you like the new tokens in step 2 to be called, and should the accent tokens stay on
.ws-rootor move to:root?CONTRIBUTING asks for a discussion before a design change and takes refactor-only PRs only on request, so I am asking first. If you want this, I can send it as small PRs in the order above, each with before and after screenshots in light and dark.
Acceptance Criteria
Alternatives Considered
color-mix()against white and black. A deployment would set a single variable, but today's hand-picked values would shift, which makes it a design change and not a like-for-like replacement.--color-violet-*variables. A deployment can already remap that scale to re-color the utility classes, and the stylesheets would follow. But it names the tokens after a color and not after a role, and--ws-accentis already there.Area
UI / UX
Additional Context
Not part of this request: the Tailwind
violet-*andpurple-*utilities in TS and TSX (about 1,000 uses), which a deployment can already re-color by remapping the scale variables; literal colors in TSX; and--primaryinapp/globals.css.The counts are from
mainata17795c3. A color counts as violet when its OKLCH hue is between 286 and 314 and its chroma is at least 0.012, which is the test our script uses.Every literal, by file
components/workbench/workspace-shell.css: 43Already the accent of the mode the rule applies to (15):
.ws-canvasbackground-imagergba(124, 58, 237, 0.062),rgba(124, 58, 237, 0).dark .ws-canvasbackground-imagergba(167, 139, 250, 0.075),rgba(167, 139, 250, 0).ws-hero-markfilterrgba(124, 58, 237, 0.22).dark .ws-hero-markfilterrgba(167, 139, 250, 0.26).ws-nav-item:hoverbackgroundrgba(124, 58, 237, 0.06).dark .ws-nav-item:hoverbackgroundrgba(167, 139, 250, 0.08).ws-account:hover, .ws-account[data-state='open']backgroundrgba(124, 58, 237, 0.07).dark .ws-account:hover, .dark .ws-account[data-state='open']backgroundrgba(167, 139, 250, 0.1).ws-mini-seg-oncolor#7c3aed.ws-head-chat:hoverbackgroundrgba(124, 58, 237, 0.08).dark .ws-head-chat:hoverbackgroundrgba(167, 139, 250, 0.12).dark .ws-root .ws-composerborder-colorrgba(167, 139, 250, 0.28).dark .ws-tour-cardbox-shadowrgba(167, 139, 250, 0.12)The light accent, in a rule that applies in dark mode too (12):
.ws-root .ws-new:hoverborder-colorrgba(124, 58, 237, 0.3).ws-account-mini[data-state='open']box-shadowrgba(124, 58, 237, 0.18).ws-account-signinbackground#7c3aed.ws-account-signinbox-shadowrgba(124, 58, 237, 0.6).ws-page-btn:hover:not(:disabled)border-colorrgba(124, 58, 237, 0.3).ws-head-icon:hover:not(:disabled)backgroundrgba(124, 58, 237, 0.08).ws-gh-pill:hoverborder-colorrgba(124, 58, 237, 0.3).ws-tour-progress > spanbackground#7c3aed.ws-tour-btn-primary, .ws-tour-btn-primary:hoverbackground#7c3aed.ws-tour-btn-primary, .ws-tour-btn-primary:hoverbox-shadowrgba(124, 58, 237, 0.55).ws-pane-hint-okbackground#7c3aed.ws-page-btn-primary, .dark .ws-page-btn-primarybackground#7c3aedAnother violet (16):
.ws-root .ws-canvasbackground-imagergba(176, 160, 255, 0.16),rgba(214, 196, 255, 0.2).dark .ws-root .ws-canvasbackground-imagergba(139, 92, 246, 0.14),rgba(124, 58, 237, 0.1).ws-avatarbackground#c4b5fd,#8b5cf6.ws-account-signin:hoverbackground#6d28d9.ws-account-summarybackground#f6f3ff.dark .ws-account-summarybackgroundrgba(139, 92, 246, 0.16).dark .ws-mini-seg-oncolor#c4b5fd.ws-course-card-blankbackground#f3f0ff.dark .ws-course-card-blankbackgroundrgba(139, 92, 246, 0.12).ws-root .ws-composerborder-color#ddd6ff.ws-root .ws-composer:hoverborder-color#cfc5ff.dark .ws-root .ws-composerbox-shadowrgba(139, 92, 246, 0.35).ws-tour-progress > spanbackground#8b5cf6components/workbench/composer-input.css: 7Another violet (7):
.composer-chipbackground#f3efff.composer-chipcolor#6d28d9.dark .composer-chipbackgroundrgba(139, 92, 246, 0.2).dark .composer-chipcolor#c4b5fd.composer-chip[data-surface='bubble']color#6d28d9.dark .composer-chip[data-surface='bubble']backgroundrgba(196, 181, 253, 0.18).dark .composer-chip[data-surface='bubble']color#ddd6fecomponents/classroom/course-end/course-end.css: 6Another violet (6):
.ce-coinbox-shadowrgba(49, 16, 102, 0.45).ce-millbackgroundrgba(40, 10, 90, 0.22).ce-discbox-shadowrgba(40, 10, 90, 0.32),rgba(40, 10, 90, 0.14).ce-grooveborderrgba(40, 10, 90, 0.2).ce-groovebox-shadowrgba(40, 10, 90, 0.1)All reactions