Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: the browser chrome takes the theme's background colour

The theme-color meta was a fixed mauve, so a phone's status bar and an installed
app's title bar stayed mauve under every theme, light ones included. The theme
effect sets it from the computed --bg after each change, and again when the OS
scheme changes under auto.
This commit is contained in:
iris 2026-11-28 02:45:38 +01:00 • committed by mara
commit 868b8743d8

View file

@ -0,0 +1,22 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { themeColorOf } from "../../shared/src/settings/theme-color.ts";
test("a computed hex background is the theme colour", () => {
assert.equal(themeColorOf(" #1e1e2e "), "#1e1e2e");
assert.equal(themeColorOf("#fff"), "#fff");
});
test("a functional colour is the theme colour", () => {
assert.equal(themeColorOf("rgb(30, 30, 46)"), "rgb(30, 30, 46)");
assert.equal(
themeColorOf("color(srgb 0.1 0.1 0.2)"),
"color(srgb 0.1 0.1 0.2)",
);
});
test("anything that isn't a colour is skipped", () => {
assert.equal(themeColorOf(""), null);
assert.equal(themeColorOf("var(--base00)"), null);
assert.equal(themeColorOf("not a colour"), null);
});