feat(webui): smooth theme changes and sun-moon transitions (#6450)

* feat(webui): smooth theme changes and sun-moon transitions

* test(webui): respect theme cooldown in diagram checks
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-25 19:15:27 +08:00
1 parent 4f7c4f0885
commit 3ede000ad4
12 files changed
+305 -17

No files matched your search

+2
View File
@@ -200,8 +200,10 @@ test("published Pele renders Chinese wrapping and mixed measured styles across w
}
for (const theme of ["light", "dark"]) {
if (await page.evaluate(() => document.documentElement.classList.contains("dark")) !== (theme === "dark")) {
await expect(page.locator("html")).not.toHaveAttribute("data-theme-transition");
const previous = await image.getAttribute("src");
await page.getByRole("button", { name: "Toggle theme" }).click();
await expect.poll(() => page.evaluate(() => document.documentElement.classList.contains("dark"))).toBe(theme === "dark");
await expect(image).not.toHaveAttribute("src", previous!);
}
await image.scrollIntoViewIfNeeded();