Skip to content

feat(app): use the project color as the primary color of the admin UI - #432

Open
slyk wants to merge 1 commit into
LaWebcapsule:mainfrom
slyk:upstream/project-color
Open

slyk wants to merge 1 commit into
LaWebcapsule:mainfrom
slyk:upstream/project-color

Conversation

@slyk

@slyk slyk commented Oct 15, 2026

Copy link
Copy Markdown

Change description

Part of discussion #431 (item 1).

The "Project Color" in Settings now becomes the primary color of the whole admin UI: buttons, links, toggles, focus rings and selections. Before, it only tinted the logo square and the favicon, because --primary and its shades (--primary-10 … --primary-190) are generated by Sass from a fixed purple at build time. For new users this is the easiest way to give the admin their own look, without touching CSS.

How it works:

  • app/src/utils/project-primary-vars.ts computes --primary and every shade with CSS color-mix(), using the same mixing rules as the Sass generate-colors palette. The themes expose the colors to mix with (--primary-mix-pos / --primary-mix-neg), so light and dark mode stay correct, including auto.
  • app.vue applies the variables on <body>, not on the app root, so teleported menus and dialogs (#menu-outlet, #dialog-outlet) are covered too.
  • Without a project color, or in a browser without color-mix() support, nothing is set and the stock purple palette is used as before.
  • A unit test pins the generated values to the Sass palette for the default purple, so the two cannot drift apart.

Screenshots and a screencast are in #431.

Type of change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)

Related issues

Discussion #431

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered: UI only. The value comes from the existing project_color setting, which only admins can change, and is only used inside CSS custom properties.
  • Code follows company security practices and guidelines

Network

  • Changes to network configurations have been reviewed (not applicable)
  • Any newly exposed public endpoints or data have gone through security review (not applicable)

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as
    necessary
  • reviewers assigned
  • Pull request linked to task tracker where applicable

--primary and its shades were generated by Sass from a fixed purple, so the
Project Color setting only tinted the logo and the favicon. Override them on
<body> with CSS color-mix(), using the same mixing rules as the Sass palette
(the themes expose the mix colors as --primary-mix-pos/-neg). Body, not the
app root, so teleported menus and dialogs are covered too. Without a project
color, or without color-mix() support, the stock palette is unchanged.

Discussion: LaWebcapsule#431
Signed-off-by: Kyrylo Kuzmytskyi <slykirill@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants