Tell the browser which colour scheme the page is in

The parts of a form control the browser draws itself -- a number input's
stepper, a date field's calendar button and popup, a select's dropdown,
scrollbars, the autofill tint -- were painted in the light appearance on
every theme. Bambuddy switches theme by swapping CSS variables under a
`dark` class, which the browser cannot see, so it assumed the page was
light and matched the steppers to a white background that was not there.

Declaring color-scheme alongside the variables fixes all of them at once,
in both directions. It goes on `.dark` rather than the per-palette
classes because the kiosk sets `dark` on the root element directly.

Three date and time fields had been pinned to dark by hand to work
around this and no longer need to be; being pinned, they were wrong
under the light theme anyway.
This commit is contained in:
maziggy
2026-08-11 12:16:31 +02:00
parent 0229d61cea
commit 4a65abe228
7 changed files with 26 additions and 8 deletions
@@ -1270,7 +1270,7 @@ export function GitHubBackupSettings() {
<input
type="time"
value={localBackupStatus?.time ?? '03:00'}
className="w-full h-10 px-3 py-2 bg-bambu-dark border border-bambu-dark-tertiary rounded-lg text-white focus:border-bambu-green focus:outline-none [color-scheme:dark]"
className="w-full h-10 px-3 py-2 bg-bambu-dark border border-bambu-dark-tertiary rounded-lg text-white focus:border-bambu-green focus:outline-none"
onChange={async (e) => {
try {
await api.updateSettings({ local_backup_time: e.target.value });