fix(cms): KDS card text legible on dark mode
The age-escalation highlights (bg-amber-1 / bg-orange-1 / bg-red-1) are very pale Quasar shades. On LNbits dark mode the q-card inherits a near-white text color from the theme — paired with the pale background that's white-on-cream, which is what the user reported: the '1x Coffee' on a ready-card was barely visible. Pin an explicit text-grey-9 alongside each pale bg so dark text on light background renders in both themes. The 'no highlight' branch returns '' unchanged, so non-aged orders still use the q-card's theme-aware default text color.
This commit is contained in:
parent
638f36e945
commit
42746d7321
2 changed files with 29 additions and 3 deletions
20
docs/cms.md
20
docs/cms.md
|
|
@ -73,6 +73,26 @@ orange, `>15min` red) and offers one-tap state transitions.
|
|||
Today the monitor + KDS poll every 5–8 s. SSE / Nostr push is on
|
||||
the roadmap.
|
||||
|
||||
### Dark-mode color discipline
|
||||
|
||||
Quasar's pale `bg-{color}-1` utility classes (e.g. `bg-orange-1`,
|
||||
`bg-red-1`, `bg-amber-1`) pair fine with the default light theme
|
||||
but render **white-on-cream** under LNbits' dark theme — the
|
||||
q-card otherwise inherits the body's light text color. The KDS
|
||||
cards pin a dark text class alongside every pale background so
|
||||
the card stays legible regardless of theme:
|
||||
|
||||
```js
|
||||
if (order.status === 'ready') return 'bg-amber-1 text-grey-9'
|
||||
if (ageSec > 900) return 'bg-red-1 text-grey-9'
|
||||
if (ageSec > 300) return 'bg-orange-1 text-grey-9'
|
||||
return '' // theme-default branch keeps q-card's own text color
|
||||
```
|
||||
|
||||
Any future surface that ages / escalates with `bg-{color}-1` must
|
||||
do the same. Never assume a pale background "just works" on dark
|
||||
theme.
|
||||
|
||||
## Settings
|
||||
|
||||
`settings.html` saves restaurant fields via
|
||||
|
|
|
|||
|
|
@ -25,10 +25,16 @@ window.app = Vue.createApp({
|
|||
},
|
||||
cardClass(order) {
|
||||
// Visually escalate as orders age. >5min = highlight; >15min = alarm.
|
||||
//
|
||||
// Pair every pale `bg-{color}-1` with an explicit dark text color
|
||||
// — otherwise on LNbits dark mode the q-card inherits light text
|
||||
// and renders white-on-cream, which is unreadable. The non-
|
||||
// highlighted branch (default theme) returns '' so the q-card
|
||||
// keeps its theme-aware defaults.
|
||||
const ageSec = (Date.now() - new Date(order.time).getTime()) / 1000
|
||||
if (order.status === 'ready') return 'bg-amber-1'
|
||||
if (ageSec > 900) return 'bg-red-1'
|
||||
if (ageSec > 300) return 'bg-orange-1'
|
||||
if (order.status === 'ready') return 'bg-amber-1 text-grey-9'
|
||||
if (ageSec > 900) return 'bg-red-1 text-grey-9'
|
||||
if (ageSec > 300) return 'bg-orange-1 text-grey-9'
|
||||
return ''
|
||||
},
|
||||
async fetchActive() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue