feat(waiter): the look on the shared tokens; the venue's colour (platform-v2 step 4.6)
- The waiter's --bg/--text/--accent… are made of @xenia/ui tokens: light / dark (user menu) and the venue's accent reach every screen; the 751 colour literals in waiter_pwa/src became tokens (by hue family and lightness), hex-alpha suffixes became fade() (color-mix), fixing 'var(--accent)18' tints that never showed. - @xenia/ui: new `special` (violet: offers, discounts, deals; contrast-tested) and `on-colour` tokens. - Setting venue.theme (teal | amber | blue | violet | rose, default amber), bootstrap venue.theme, manager Settings → Venue → Colour; the waiter sets data-venue-theme and the theme before the first render. - Guard tests/no-colours.test.mjs; tests/e2e/waiter_look.mjs (every page light + dark, side-by-side compare page); waiter e2e +3; backend test_venue_theme.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import '@xenia/ui/tokens.css' // shared --x-* tokens; the waiter's own --bg/--text… stay as they are
|
||||
import '@xenia/ui/tokens.css' // shared --x-* tokens: the waiter's --bg/--text… are made of them (4.6)
|
||||
import './index.css'
|
||||
|
||||
// The theme before anything renders (no light flash on a dark phone): the user's light/dark
|
||||
// (themeStore, default dark) and the waiter's default accent until bootstrap says the venue's.
|
||||
try {
|
||||
const saved = JSON.parse(localStorage.getItem('pos-theme') || 'null')
|
||||
document.documentElement.setAttribute('data-theme', saved?.state?.dark === false ? 'light' : 'dark')
|
||||
} catch { document.documentElement.setAttribute('data-theme', 'dark') }
|
||||
document.documentElement.setAttribute('data-venue-theme', 'amber')
|
||||
import App from './App.jsx'
|
||||
import db from './db/posdb.js'
|
||||
import { deliveryMode, getActiveVenue } from './config/server'
|
||||
|
||||
Reference in New Issue
Block a user