From ab7b3ecf47da78d938efe313221baa4ae55732cb Mon Sep 17 00:00:00 2001 From: tianma-if Date: Thu, 10 Sep 2026 18:23:42 +0800 Subject: [PATCH] fix(web): paint dark mode from CSS tokens instead of utility remaps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drive light and dark from one token table so Tailwind utilities follow :root.dark assignments. Drop the leftover dark: color variants and the [class~="…"] inversion layer, and keep PDF paper as a white surface. --- apps/web/postcss.config.js | 9 +- apps/web/src/app/App.tsx | 2 +- apps/web/src/components/AiPromptsPane.tsx | 18 +- apps/web/src/components/AssetsPane.tsx | 20 +- .../src/components/CompanionActionCard.tsx | 36 +- .../src/components/CompanionDiscoveryHub.tsx | 36 +- apps/web/src/components/CompanionPane.tsx | 2 +- .../components/CompanionToolActionCard.tsx | 32 +- .../DesktopRendererErrorBoundary.tsx | 4 +- apps/web/src/components/DiagramToolbar.tsx | 2 +- apps/web/src/components/EditorPane.tsx | 18 +- .../components/EditorPaneErrorBoundary.tsx | 6 +- apps/web/src/components/EditorTagPicker.tsx | 2 +- apps/web/src/components/EditorToolbar.tsx | 20 +- .../components/EvernoteImportGuidePane.tsx | 4 +- apps/web/src/components/LoginScreen.tsx | 10 +- apps/web/src/components/MemoCard.tsx | 14 +- .../components/MemoEditorHeaderActions.tsx | 2 +- .../src/components/MemoEditorMetadataRow.tsx | 2 +- apps/web/src/components/MemoListPane.tsx | 36 +- apps/web/src/components/NotebookPane.tsx | 70 ++-- apps/web/src/components/NotebookTreeItem.tsx | 6 +- .../src/components/PluginMarketplacePane.tsx | 2 +- apps/web/src/components/PublicSharePage.tsx | 4 +- apps/web/src/components/PwaIosPrompt.tsx | 6 +- apps/web/src/components/PwaUpdateNotice.tsx | 2 +- apps/web/src/components/SettingsPane.tsx | 11 +- apps/web/src/components/TagsPane.tsx | 4 +- apps/web/src/components/TemplatesPane.tsx | 22 +- apps/web/src/components/ThemeProvider.tsx | 2 +- apps/web/src/components/WorkspaceApp.tsx | 10 +- .../components/dialogs/AiAssistantDialog.tsx | 10 +- .../src/components/dialogs/ConfirmDialogs.tsx | 4 +- .../dialogs/RevisionHistoryDialog.tsx | 8 +- .../dialogs/ShareNoteImageDialog.tsx | 8 +- .../components/dialogs/TemplatesDialog.tsx | 8 +- .../editor/EditorNoteLinkPicker.tsx | 2 +- .../components/editor/EditorPaneChrome.tsx | 4 +- .../src/components/editor/FileAttachment.tsx | 2 +- .../web/src/components/editor/PluginEmbed.tsx | 2 +- .../execution/ExecutionCenterPane.tsx | 4 +- .../execution/ExecutionHistoryItemCard.tsx | 2 +- apps/web/src/components/pdf/PdfThumbnail.tsx | 2 +- apps/web/src/components/pdf/PdfViewer.tsx | 8 +- .../components/plugins/PluginCatalogCard.tsx | 2 +- .../components/plugins/PluginPanelDialog.tsx | 2 +- .../components/plugins/PluginUpdateDialog.tsx | 2 +- .../components/settings/AdvancedPlayCard.tsx | 4 +- .../src/components/settings/AiModelCard.tsx | 12 +- .../src/components/settings/AiPromptsCard.tsx | 2 +- .../components/settings/AiProviderCard.tsx | 2 +- .../settings/AiTagSuggestionPromptCard.tsx | 2 +- .../CompanionDiscoverySettingsCard.tsx | 78 ++-- .../settings/CustomEditorThemeDialog.tsx | 8 +- .../settings/DesktopLocalBackupCard.tsx | 2 +- .../settings/EvernoteImportGuideCard.tsx | 2 +- .../src/components/settings/McpConfigCard.tsx | 12 +- .../components/settings/ObjectStorageCard.tsx | 2 +- .../components/settings/PluginManagerCard.tsx | 6 +- .../settings/PreferenceCard.test.mjs | 12 + .../components/settings/PreferenceCard.tsx | 40 +- .../settings/ShortcutSettingsItem.tsx | 4 +- .../components/settings/SystemInfoPanel.tsx | 8 +- .../components/settings/WebDavBackupCard.tsx | 2 +- apps/web/src/components/ui/alert.tsx | 4 +- apps/web/src/components/ui/badge.tsx | 4 +- apps/web/src/components/ui/button.tsx | 2 +- apps/web/src/components/ui/card.tsx | 2 +- apps/web/src/components/ui/checkbox.tsx | 2 +- apps/web/src/components/ui/command.tsx | 2 +- apps/web/src/components/ui/context-menu.tsx | 4 +- apps/web/src/components/ui/dialog.tsx | 4 +- apps/web/src/components/ui/drawer.tsx | 2 +- apps/web/src/components/ui/dropdown-menu.tsx | 4 +- apps/web/src/components/ui/input.tsx | 2 +- apps/web/src/components/ui/select.tsx | 4 +- apps/web/src/components/ui/switch.tsx | 2 +- apps/web/src/components/ui/tooltip.tsx | 2 +- apps/web/src/lib/dark-theme.test.mjs | 35 +- apps/web/src/lib/markdown-theme.test.mjs | 6 + apps/web/src/lib/tailwind-theme.test.mjs | 16 + apps/web/src/lib/ui-palette.test.mjs | 5 + apps/web/src/styles/globals.css | 366 ++++++------------ apps/web/tailwind.config.ts | 30 +- packages/shared/src/i18n/en-US.ts | 2 +- packages/shared/src/i18n/zh-CN.ts | 2 +- tailwind.config.ts | 21 +- 87 files changed, 590 insertions(+), 615 deletions(-) create mode 100644 apps/web/src/lib/tailwind-theme.test.mjs diff --git a/apps/web/postcss.config.js b/apps/web/postcss.config.js index 2aa7205d..a4f5d1d6 100644 --- a/apps/web/postcss.config.js +++ b/apps/web/postcss.config.js @@ -1,6 +1,13 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const configDirectory = path.dirname(fileURLToPath(import.meta.url)); + export default { plugins: { - tailwindcss: {}, + tailwindcss: { + config: path.join(configDirectory, "tailwind.config.ts"), + }, autoprefixer: {}, }, }; diff --git a/apps/web/src/app/App.tsx b/apps/web/src/app/App.tsx index db910010..63b8fe43 100644 --- a/apps/web/src/app/App.tsx +++ b/apps/web/src/app/App.tsx @@ -172,7 +172,7 @@ const AuthenticatedWorkspace = () => { if (desktopScopeError) { return (
-
+

{t("login.desktopScopeUnavailable")}