ui(env): explicit switcher button+modal, forced selection, 3px color bar
- Replace EnvironmentSelector "All Envs" dropdown with Button+Modal (DS Modal, forced on first-use). - Add 8-swatch preset color picker in the Environment settings "Appearance" section; commits via useUpdateEnvironment. - Render a 3px fixed top bar in the current env's color across every page (z-index 900, below DS modals). - New env-colors tokens (--env-color-*, light + dark) and envColorVar() helper with slate fallback. - Vitest coverage for button, modal, and color helpers (13 new specs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
34
ui/src/styles/env-colors.css
Normal file
34
ui/src/styles/env-colors.css
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Per-environment preset color tokens. Used by:
|
||||
* - LayoutShell's 3px top-bar indicator
|
||||
* - EnvironmentSwitcherButton / EnvironmentSwitcherModal (color dot)
|
||||
* - EnvironmentsPage "Appearance" swatch grid
|
||||
*
|
||||
* Light-mode and dark-mode values are tuned for WCAG-AA contrast against the
|
||||
* respective surface tokens (`--bg-surface`, `--text-primary`).
|
||||
*
|
||||
* Storage: plain lowercase string ("slate", "red", ...). Unknown values fall
|
||||
* back to `slate` via `envColorVar()`.
|
||||
*/
|
||||
|
||||
:root {
|
||||
--env-color-slate: #94a3b8;
|
||||
--env-color-red: #ef4444;
|
||||
--env-color-amber: #f59e0b;
|
||||
--env-color-green: #10b981;
|
||||
--env-color-teal: #14b8a6;
|
||||
--env-color-blue: #3b82f6;
|
||||
--env-color-purple: #a855f7;
|
||||
--env-color-pink: #ec4899;
|
||||
}
|
||||
|
||||
[data-theme='dark'] {
|
||||
--env-color-slate: #a1a9b8;
|
||||
--env-color-red: #f87171;
|
||||
--env-color-amber: #fbbf24;
|
||||
--env-color-green: #34d399;
|
||||
--env-color-teal: #2dd4bf;
|
||||
--env-color-blue: #60a5fa;
|
||||
--env-color-purple: #c084fc;
|
||||
--env-color-pink: #f472b6;
|
||||
}
|
||||
Reference in New Issue
Block a user