Undefined CSS tokens draw borders and text in the wrong colour #268

Closed
opened 2026-10-07 20:42:52 -04:00 by Salastil · 2 comments
Owner

Seven custom properties are used in app.css but never defined in theme.css: --on-primary, --on-surface, --on-surface-variant, --outline-variant, --outline-low, --outline-faint, --surface-text-muted. Ten uses have no fallback.

With no value, border: 1px solid var(--outline-variant) falls back to currentColor - the bright text colour instead of a subtle outline - and color: var(--on-primary) silently inherits.

Visible in:

  • ExportDialog's date fields (.export-range input[type=datetime-local], app.css ~6005/6008)
  • .emoji-jump (~5812), .kick-points (~5873), .emoji-body (~7614), .emoji-footer (~7677), .search-filters (~1248)
  • .history-gap (~1288), .voice-play (~3749, play icon on a blue button), .voice-speed.changed (~3833)

Fix: define each as an alias of an existing token in theme.css (e.g. --on-primary: var(--primary-text)), and add a check that every var(--x) used in the CSS is defined.

Part of the v1.0 UI pass.

Seven custom properties are used in `app.css` but never defined in `theme.css`: `--on-primary`, `--on-surface`, `--on-surface-variant`, `--outline-variant`, `--outline-low`, `--outline-faint`, `--surface-text-muted`. Ten uses have no fallback. With no value, `border: 1px solid var(--outline-variant)` falls back to `currentColor` - the bright text colour instead of a subtle outline - and `color: var(--on-primary)` silently inherits. Visible in: - ExportDialog's date fields (`.export-range input[type=datetime-local]`, app.css ~6005/6008) - `.emoji-jump` (~5812), `.kick-points` (~5873), `.emoji-body` (~7614), `.emoji-footer` (~7677), `.search-filters` (~1248) - `.history-gap` (~1288), `.voice-play` (~3749, play icon on a blue button), `.voice-speed.changed` (~3833) **Fix:** define each as an alias of an existing token in `theme.css` (e.g. `--on-primary: var(--primary-text)`), and add a check that every `var(--x)` used in the CSS is defined. _Part of the v1.0 UI pass._
Salastil added this to the v1.0 milestone 2026-10-07 20:42:52 -04:00
Salastil added the bug label 2026-10-07 20:42:52 -04:00
Author
Owner

Before and after, captured by scripts/ui-shots.mjs from an isolated copy of the app (before = 88375ba, after = 3cdfe37). The fix is commit 9db25c8.

Export dialog, "A range" selected

Export dialog, "A range" selected

The date fields' border: 1px solid var(--outline-variant) used an undefined property, which makes the whole declaration invalid, so they had no border at all before. They now draw the medium outline. The picture is subtle on purpose: the bug was a missing border, not a wrong colour. The focus ring on the radio also changed from the browser's default to the app's blue ring (a #282 change).

Every other use of the seven undefined properties (the emoji picker, history gap, voice play button, search filters, Kick points) is fixed the same way, and src/renderer/src/styles.test.ts now fails if the stylesheet ever uses an undefined property again.

Before and after, captured by `scripts/ui-shots.mjs` from an isolated copy of the app (before = `88375ba`, after = `3cdfe37`). The fix is commit `9db25c8`. **Export dialog, "A range" selected** ![Export dialog, "A range" selected](https://git.salastil.com/attachments/4c996f86-e126-41b2-965b-479a87822dd5) The date fields' `border: 1px solid var(--outline-variant)` used an undefined property, which makes the whole declaration invalid, so they had no border at all before. They now draw the medium outline. The picture is subtle on purpose: the bug was a missing border, not a wrong colour. The focus ring on the radio also changed from the browser's default to the app's blue ring (a #282 change). Every other use of the seven undefined properties (the emoji picker, history gap, voice play button, search filters, Kick points) is fixed the same way, and `src/renderer/src/styles.test.ts` now fails if the stylesheet ever uses an undefined property again.
Author
Owner

Finished: 9db25c8. Before/after above.

Finished: [9db25c8](https://git.salastil.com/Salastil/moho/commit/9db25c8d73a9b80332ba69602d8ce5936771d41b). Before/after above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#268