Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/src/components/theme-swatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function SwatchStrip({ palette }: { palette: string }) {
/**
* Previews a theme through its own tokens: `data-palette` scopes tokens.css,
* so the strip shows that theme's surface, accent, success and error. Two
* palettes split the swatch, e.g. System's light and dark.
* palettes split the swatch, e.g. Auto's light and dark.
*/
export function ThemeSwatch({
palettes,
Expand Down
12 changes: 9 additions & 3 deletions apps/web/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ function bundled(name: string): ThemesType {
export const THEMES = [
{
id: "system",
label: "System",
label: "Auto",
kind: "base",
mode: "system",
code: pierre,
},
{ id: "light", label: "Light", kind: "base", mode: "light", code: pierre },
{ id: "dark", label: "Dark", kind: "base", mode: "dark", code: pierre },
{
id: "light",
label: "diffx Light",
kind: "base",
mode: "light",
code: pierre,
},
{ id: "dark", label: "diffx Dark", kind: "base", mode: "dark", code: pierre },
{
id: "catppuccin",
label: "Catppuccin",
Expand Down
8 changes: 4 additions & 4 deletions apps/web/test/browser/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1585,16 +1585,16 @@ test("settings theme picker follows system, applies palettes and persists", asyn
// One flat list: no group headings.
await expect(themes.getByRole("group")).toHaveCount(0);
await expect(
themes.getByRole("radio", { name: "System", exact: true }),
themes.getByRole("radio", { name: "Auto", exact: true }),
).toBeChecked();

await themes.getByRole("radio", { name: "Light", exact: true }).click();
await themes.getByRole("radio", { name: "diffx Light", exact: true }).click();
await expect(html).toHaveAttribute("data-theme", "light");
await expect.poll(savedTheme).toBe("light");
// Arrow keys move and select, like native radios.
await page.keyboard.press("ArrowDown");
await expect(
themes.getByRole("radio", { name: "Dark", exact: true }),
themes.getByRole("radio", { name: "diffx Dark", exact: true }),
).toBeChecked();
await expect(html).toHaveAttribute("data-theme", "dark");

Expand All @@ -1618,7 +1618,7 @@ test("settings theme picker follows system, applies palettes and persists", asyn
await expect(html).toHaveAttribute("data-palette", "flexoki-light");
await expect(html).toHaveAttribute("data-theme", "light");

await themes.getByRole("radio", { name: "System", exact: true }).click();
await themes.getByRole("radio", { name: "Auto", exact: true }).click();
await expect(html).not.toHaveAttribute("data-palette");
await expect(html).toHaveAttribute("data-theme", "dark");
await page.emulateMedia({ colorScheme: "light" });
Expand Down
Loading