[PR #6949] feat(frontend): accent colors and an optional glassy style #6535

Open
opened 2026-11-02 04:09:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6949
Author: @Plus98ir
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: feat/accent-colors-glassy


📝 Commits (7)

  • 169d3c9 feat(frontend): pick an accent color for the light, dark and ultra-dark themes
  • 6bd430b feat(frontend): add an optional glassy style for every theme
  • 19b455b fix(frontend): overview sparklines follow the accent color; a wider glassy glow
  • 6cb36ae fix(frontend): keep the mobile menu's search box full size; brighter dark accents
  • aa1badd fix(frontend): keep the accent popover on screen in the mobile menu
  • 7ad962c fix(frontend): size the mobile menu to its content
  • 50848b3 fix(frontend): command palette and glass glow follow the accent again

📊 Changes

24 files changed (+649 additions, -42 deletions)

View changed files

📝 frontend/src/components/command-palette/CommandPalette.css (+11 -11)
📝 frontend/src/components/command-palette/CommandPalette.tsx (+1 -1)
📝 frontend/src/components/form/DateTimePicker.tsx (+7 -6)
📝 frontend/src/hooks/useTheme.tsx (+176 -18)
📝 frontend/src/layouts/AppSidebar.css (+64 -0)
📝 frontend/src/layouts/AppSidebar.tsx (+65 -4)
📝 frontend/src/models/status.ts (+2 -1)
📝 frontend/src/pages/index/VitalTile.tsx (+4 -1)
➕ frontend/src/styles/glass.css (+106 -0)
➕ frontend/src/test/accent-root-var.test.tsx (+59 -0)
📝 internal/web/translation/ar-EG.json (+11 -0)
📝 internal/web/translation/en-US.json (+11 -0)
📝 internal/web/translation/es-ES.json (+11 -0)
📝 internal/web/translation/fa-IR.json (+11 -0)
📝 internal/web/translation/id-ID.json (+11 -0)
📝 internal/web/translation/ja-JP.json (+11 -0)
📝 internal/web/translation/pt-BR.json (+11 -0)
📝 internal/web/translation/ru-RU.json (+11 -0)
📝 internal/web/translation/sk-SK.json (+11 -0)
📝 internal/web/translation/tr-TR.json (+11 -0)

...and 4 more files

📄 Description

Summary

Adds an accent color picker (7 colors) and an optional "Glassy style" to the panel. Both work with the light, dark and ultra-dark themes and are saved per browser, the same way the theme is. With the defaults the panel looks exactly as it does today.

Why

Admins who run several panels want to tell them apart at a glance, and some want a softer look. Today the only appearance choice is light/dark/ultra-dark with a fixed blue.

What changes

  • Accent color: a palette button next to the theme switch, in the sidebar and in the mobile drawer. It offers seven swatches: the panel's own blue (default), red, pink, orange, yellow, green and purple. The choice becomes Ant Design's colorPrimary, so buttons, links, the active menu item, tabs and switches follow it.
    • Each color has its own shade per mode. On light, white text on it keeps a contrast of at least 4.5:1. On dark and ultra-dark it stays readable on cards, and orange, yellow and green buttons get dark text where white would fail contrast.
    • The command palette, the Jalali date picker and the overview sparklines now read the accent instead of a hard-coded blue.
  • Glassy style: a switch under the swatches.
    • Cards, the sidebar, the drawer and dialogs become frosted glass (translucent surface and backdrop blur) over a soft glow in the accent color. The main button gets an accent gradient.
    • Popups stay nearly opaque, so menus and pickers stay readable over busy pages.
    • Fixed table columns and sticky headers stay solid, so scrolled rows never show through them.
  • Mobile menu: the drawer is sized to its content (about 265px instead of a fixed width). The accent popover stays on screen inside it.
  • The new labels are translated into all 14 panel languages.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

  • Frontend only, with no backend or API change. npm run typecheck, npm run lint, npm run format:check, npm run build and the unit tests pass (1422 tests). make gen leaves src/generated unchanged.
  • Manual checks in Chrome (desktop and phone width): every color on light, dark and ultra-dark, with Glassy style on and off. Checked the sidebar, the mobile drawer, the command palette, the Jalali date picker, the overview tiles, tables with fixed columns, modals and dropdowns.
  • Has been running on two production panels (v3.10.2, then v3.11.0) since 2026-10-25.

Screenshots / recordings

Accent picker (sidebar, light theme):

accent picker

Glassy style, dark + green:

glassy dark green

Glassy style, light + pink:

glassy light pink

Glassy style, ultra-dark + orange (Inbounds):

glassy ultra-dark orange

Breaking changes

None. The defaults (blue accent, Glassy style off) keep today's look. Both choices live in localStorage only.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable). (Visual-only change: no unit test can catch it.)
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6949 **Author:** [@Plus98ir](https://github.com/Plus98ir) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/accent-colors-glassy` --- ### 📝 Commits (7) - [`169d3c9`](https://github.com/MHSanaei/3x-ui/commit/169d3c97bd009b9ebe442e9455cd07628118ace0) feat(frontend): pick an accent color for the light, dark and ultra-dark themes - [`6bd430b`](https://github.com/MHSanaei/3x-ui/commit/6bd430b5392fc85cd7e7ce8af6a2828b66132944) feat(frontend): add an optional glassy style for every theme - [`19b455b`](https://github.com/MHSanaei/3x-ui/commit/19b455b7b6f5f4e10c28f505e206299ae1e2f135) fix(frontend): overview sparklines follow the accent color; a wider glassy glow - [`6cb36ae`](https://github.com/MHSanaei/3x-ui/commit/6cb36ae6b7518912375be2951de05e6e98ee8dea) fix(frontend): keep the mobile menu's search box full size; brighter dark accents - [`aa1badd`](https://github.com/MHSanaei/3x-ui/commit/aa1badd10d00ebfa37e650f140f3fd4ca0db5351) fix(frontend): keep the accent popover on screen in the mobile menu - [`7ad962c`](https://github.com/MHSanaei/3x-ui/commit/7ad962c18ca5db77a4b54f51466a333e89dd5c80) fix(frontend): size the mobile menu to its content - [`50848b3`](https://github.com/MHSanaei/3x-ui/commit/50848b3020752f90ecb87929123706319f1ecb6d) fix(frontend): command palette and glass glow follow the accent again ### 📊 Changes **24 files changed** (+649 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/command-palette/CommandPalette.css` (+11 -11) 📝 `frontend/src/components/command-palette/CommandPalette.tsx` (+1 -1) 📝 `frontend/src/components/form/DateTimePicker.tsx` (+7 -6) 📝 `frontend/src/hooks/useTheme.tsx` (+176 -18) 📝 `frontend/src/layouts/AppSidebar.css` (+64 -0) 📝 `frontend/src/layouts/AppSidebar.tsx` (+65 -4) 📝 `frontend/src/models/status.ts` (+2 -1) 📝 `frontend/src/pages/index/VitalTile.tsx` (+4 -1) ➕ `frontend/src/styles/glass.css` (+106 -0) ➕ `frontend/src/test/accent-root-var.test.tsx` (+59 -0) 📝 `internal/web/translation/ar-EG.json` (+11 -0) 📝 `internal/web/translation/en-US.json` (+11 -0) 📝 `internal/web/translation/es-ES.json` (+11 -0) 📝 `internal/web/translation/fa-IR.json` (+11 -0) 📝 `internal/web/translation/id-ID.json` (+11 -0) 📝 `internal/web/translation/ja-JP.json` (+11 -0) 📝 `internal/web/translation/pt-BR.json` (+11 -0) 📝 `internal/web/translation/ru-RU.json` (+11 -0) 📝 `internal/web/translation/sk-SK.json` (+11 -0) 📝 `internal/web/translation/tr-TR.json` (+11 -0) _...and 4 more files_ </details> ### 📄 Description ## Summary Adds an accent color picker (7 colors) and an optional "Glassy style" to the panel. Both work with the light, dark and ultra-dark themes and are saved per browser, the same way the theme is. With the defaults the panel looks exactly as it does today. ## Why Admins who run several panels want to tell them apart at a glance, and some want a softer look. Today the only appearance choice is light/dark/ultra-dark with a fixed blue. ## What changes - **Accent color**: a palette button next to the theme switch, in the sidebar and in the mobile drawer. It offers seven swatches: the panel's own blue (default), red, pink, orange, yellow, green and purple. The choice becomes Ant Design's `colorPrimary`, so buttons, links, the active menu item, tabs and switches follow it. - Each color has its own shade per mode. On light, white text on it keeps a contrast of at least 4.5:1. On dark and ultra-dark it stays readable on cards, and orange, yellow and green buttons get dark text where white would fail contrast. - The command palette, the Jalali date picker and the overview sparklines now read the accent instead of a hard-coded blue. - **Glassy style**: a switch under the swatches. - Cards, the sidebar, the drawer and dialogs become frosted glass (translucent surface and backdrop blur) over a soft glow in the accent color. The main button gets an accent gradient. - Popups stay nearly opaque, so menus and pickers stay readable over busy pages. - Fixed table columns and sticky headers stay solid, so scrolled rows never show through them. - **Mobile menu**: the drawer is sized to its content (about 265px instead of a fixed width). The accent popover stays on screen inside it. - The new labels are translated into all 14 panel languages. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? - Frontend only, with no backend or API change. `npm run typecheck`, `npm run lint`, `npm run format:check`, `npm run build` and the unit tests pass (1422 tests). `make gen` leaves `src/generated` unchanged. - Manual checks in Chrome (desktop and phone width): every color on light, dark and ultra-dark, with Glassy style on and off. Checked the sidebar, the mobile drawer, the command palette, the Jalali date picker, the overview tiles, tables with fixed columns, modals and dropdowns. - Has been running on two production panels (v3.10.2, then v3.11.0) since 2026-10-25. ## Screenshots / recordings Accent picker (sidebar, light theme): ![accent picker](https://raw.githubusercontent.com/Plus98ir/3x-ui/9b3442f5556fd9bac2925164c20072428277d57c/accent-picker.png) Glassy style, dark + green: ![glassy dark green](https://raw.githubusercontent.com/Plus98ir/3x-ui/9b3442f5556fd9bac2925164c20072428277d57c/glassy-dark-green.png) Glassy style, light + pink: ![glassy light pink](https://raw.githubusercontent.com/Plus98ir/3x-ui/9b3442f5556fd9bac2925164c20072428277d57c/glassy-light-pink.png) Glassy style, ultra-dark + orange (Inbounds): ![glassy ultra-dark orange](https://raw.githubusercontent.com/Plus98ir/3x-ui/9b3442f5556fd9bac2925164c20072428277d57c/glassy-ultra-orange.png) ## Breaking changes None. The defaults (blue accent, Glassy style off) keep today's look. Both choices live in `localStorage` only. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [ ] I added or updated tests for the new behavior (when applicable). (Visual-only change: no unit test can catch it.) - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [ ] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6535
No description provided.