diff --git a/apps/desktop/src/design.test.ts b/apps/desktop/src/design.test.ts index 70d4f1491..959a89cb5 100644 --- a/apps/desktop/src/design.test.ts +++ b/apps/desktop/src/design.test.ts @@ -2,7 +2,7 @@ // palette classes outside the tokens, no retired class names, no arbitrary // radii, no native selects, hand-timed hover, hand-made blur or menu items, // no hand-styled labelled buttons, no spacing off the scale, no native `title` -// tips on controls, and index.css's built-in themes equal to BUILTIN_THEMES. +// tips on controls, no shadow outside the theme, and index.css's built-in themes equal to BUILTIN_THEMES. import { describe, expect, test } from "bun:test"; import { readdirSync, readFileSync, statSync } from "node:fs"; @@ -26,6 +26,10 @@ const RETIRED = /(? m[1]), +); +const SHADOW_CLASS = /(? { if (PALETTE.test(line)) violations.push(`${where} palette class: ${line.trim()}`); if (RETIRED.test(line)) violations.push(`${where} retired token: ${line.trim()}`); if (ARBITRARY_RADIUS.test(line)) violations.push(`${where} arbitrary radius: ${line.trim()}`); + for (const [, name] of line.matchAll(SHADOW_CLASS)) + if (name !== "none" && !THEME_SHADOWS.has(name)) + violations.push(`${where} shadow-${name} is not a theme shadow: ${line.trim()}`); if (NATIVE_SELECT.test(line)) violations.push(`${where} native select, use Select: ${line.trim()}`); if (HAND_TIMED_HOVER.test(line)) violations.push(`${where} hover is timed in index.css: ${line.trim()}`); diff --git a/apps/desktop/src/ui/HeaderButtonsSetting.tsx b/apps/desktop/src/ui/HeaderButtonsSetting.tsx index b346e9223..db5b47ec3 100644 --- a/apps/desktop/src/ui/HeaderButtonsSetting.tsx +++ b/apps/desktop/src/ui/HeaderButtonsSetting.tsx @@ -298,7 +298,7 @@ export function HeaderButtonsSetting() {