feat: generate preset-aware dark theme variables
This commit is contained in:
1 parent
48c596cf41
commit
3fd2a27719
4 files changed
+77
-14
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { themePaletteCss } from "@/lib/theme-css";
|
||||
import { PRESETS } from "@/lib/theme-presets";
|
||||
|
||||
describe("themePaletteCss", () => {
|
||||
it("emits separate preset-specific light and dark scopes", () => {
|
||||
const ocean = PRESETS.Ocean;
|
||||
const css = `${themePaletteCss(":root", ocean.light)}${themePaletteCss("html.dark", ocean.dark)}`;
|
||||
|
||||
expect(css).toContain(":root{");
|
||||
expect(css).toContain("html.dark{");
|
||||
expect(css).toContain(`--color-primary:${ocean.light.color_primary}`);
|
||||
expect(css).toContain(`--color-background:${ocean.light.color_background}`);
|
||||
expect(css).toContain(`--color-background:${ocean.dark.color_background}`);
|
||||
expect(ocean.dark.color_primary).toBe(ocean.light.color_primary);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user