Add configurable sidebar contrast settings

This commit is contained in:
2026-08-05 15:59:16 +02:00
parent a1e3f537e3
commit bf2d86329b
6 changed files with 95 additions and 4 deletions
+9 -3
View File
@@ -59,15 +59,21 @@ test("left controls open in a responsive sidebar drawer", async ({ page }) => {
test("theme toggle switches and persists dark mode", async ({ page }) => {
await page.goto("/");
await expect(page.locator("html")).not.toHaveClass(/dark/);
await page.evaluate(() => localStorage.clear());
await page.reload();
await expect(page.locator("html")).not.toHaveClass(/(?:^| )dark(?: |$)/);
const lightPanelBackground = await page.locator("#sidebarDrawer").evaluate((element) => getComputedStyle(element).backgroundColor);
await page.locator("#themeToggle").click();
await expect(page.locator("html")).toHaveClass(/dark/);
await expect(page.locator("html")).toHaveClass(/(?:^| )dark(?: |$)/);
await expect(page.locator("#themeToggle")).toHaveText("Light theme");
const darkPanelBackground = await page.locator("#sidebarDrawer").evaluate((element) => getComputedStyle(element).backgroundColor);
expect(darkPanelBackground).not.toBe(lightPanelBackground);
await page.locator("#settingsButton").click();
await page.locator("#darkContrastSelect").selectOption("high");
await expect(page.locator("html")).toHaveClass(/contrast-dark-high/);
await page.reload();
await expect(page.locator("html")).toHaveClass(/dark/);
await expect(page.locator("html")).toHaveClass(/(?:^| )dark(?: |$)/);
});