From cf21c718fac0069c36ed5121baa7a816824b72ab Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 31 May 2026 19:19:35 +0200 Subject: [PATCH] Convert the remaining dynamic and hardcoded inline styles to Tailwind utilities Second styling pass over the components and pages: move conditional theme colors into className ternaries (bg-accent / bg-surface-hover etc.), turn reused CSSProperties constants into className constants, and express static hardcoded hex/rgba colors as Tailwind arbitrary values so the exact rendered colour is preserved. Truly dynamic styling (computed geometry, gradients, multi-part shadows, data-driven colours, the undefined --sidebar/--nav layout vars) stays inline as it cannot be expressed as a static class. Updated three component tests that asserted the old inline active-state styles to assert the equivalent utility class instead. Verified: client typecheck 0, full client suite green, and a live light/dark render check in the dev server confirms the semantic theme tokens resolve correctly (the earlier 'transparent popups' were a stale dev server that pre-dated the tailwind.config token addition, not a code issue). --- client/src/components/Admin/AddonManager.tsx | 16 +- .../components/Admin/AdminMcpTokensPanel.tsx | 62 ++++--- client/src/components/Admin/AuditLogPanel.tsx | 46 +++-- client/src/components/Admin/BackupPanel.tsx | 22 +-- .../src/components/Admin/CategoryManager.tsx | 4 +- .../Admin/DefaultUserSettingsTab.tsx | 16 +- .../Admin/DevNotificationsPanel.tsx | 27 ++- client/src/components/Admin/GitHubPanel.tsx | 46 ++--- client/src/components/Collab/CollabNotes.tsx | 2 +- client/src/components/Collab/CollabPanel.tsx | 26 ++- .../Journey/ContributorInviteDialog.tsx | 2 +- .../Layout/InAppNotificationBell.tsx | 5 +- client/src/components/Layout/Navbar.tsx | 8 +- client/src/components/Layout/PageSidebar.tsx | 7 +- client/src/components/Map/MapView.tsx | 3 +- .../src/components/OAuth/ScopeGroupPicker.tsx | 2 +- .../src/components/Planner/AirportSelect.tsx | 21 +-- .../src/components/Planner/DayDetailPanel.tsx | 22 +-- .../src/components/Planner/DayPlanSidebar.tsx | 150 ++++++++-------- .../components/Planner/FileImportModal.tsx | 31 ++-- .../src/components/Planner/LocationSelect.tsx | 21 +-- .../src/components/Planner/PlaceFormModal.tsx | 2 +- .../src/components/Planner/PlaceInspector.tsx | 106 +++++------ .../src/components/Planner/PlacesSidebar.tsx | 106 +++++------ .../Planner/ReservationModal.test.tsx | 2 +- .../components/Planner/ReservationModal.tsx | 107 ++++++------ .../components/Planner/ReservationsPanel.tsx | 164 ++++++++---------- .../src/components/Planner/TransportModal.tsx | 120 ++++++------- client/src/components/Settings/AboutTab.tsx | 42 ++--- client/src/components/Settings/AccountTab.tsx | 33 ++-- .../Settings/DisplaySettingsTab.tsx | 16 +- .../components/Settings/IntegrationsTab.tsx | 42 ++--- client/src/components/Settings/OfflineTab.tsx | 30 ++-- client/src/components/Settings/Section.tsx | 8 +- client/src/components/Todo/TodoListPanel.tsx | 24 +-- .../components/Vacay/VacayCalendar.test.tsx | 2 +- client/src/components/Vacay/VacayCalendar.tsx | 14 +- .../components/Vacay/VacayMonthCard.test.tsx | 2 +- .../src/components/Vacay/VacayMonthCard.tsx | 6 +- client/src/components/Vacay/VacayPersons.tsx | 11 +- client/src/components/Vacay/VacaySettings.tsx | 22 +-- client/src/components/Vacay/VacayStats.tsx | 8 +- .../src/components/shared/ConfirmDialog.tsx | 4 +- .../src/components/shared/CopyTripDialog.tsx | 11 +- client/src/components/shared/Modal.tsx | 4 +- client/src/pages/AdminPage.tsx | 54 +++--- client/src/pages/AtlasPage.tsx | 27 +-- client/src/pages/DashboardPage.tsx | 2 +- client/src/pages/ForgotPasswordPage.tsx | 6 +- client/src/pages/InAppNotificationsPage.tsx | 15 +- client/src/pages/JourneyDetailPage.tsx | 6 +- client/src/pages/JourneyPage.tsx | 2 +- client/src/pages/LoginPage.tsx | 12 +- client/src/pages/ResetPasswordPage.tsx | 6 +- client/src/pages/SharedTripPage.tsx | 109 ++++++------ client/src/pages/TripPlannerPage.tsx | 33 ++-- client/src/pages/VacayPage.tsx | 14 +- 57 files changed, 799 insertions(+), 912 deletions(-) diff --git a/client/src/components/Admin/AddonManager.tsx b/client/src/components/Admin/AddonManager.tsx index e9d4b48d..250978ba 100644 --- a/client/src/components/Admin/AddonManager.tsx +++ b/client/src/components/Admin/AddonManager.tsx @@ -186,13 +186,13 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, {addon.id === 'packing' && addon.enabled && onToggleBagTracking && (
- +
{t('admin.bagTracking.title')}
{t('admin.bagTracking.subtitle')}
- + {bagTrackingEnabled ? t('admin.addons.enabled') : t('admin.addons.disabled')} )} {expanded && hidden > 0 && ( )}
-
+
{session.username}
@@ -164,8 +161,8 @@ export default function AdminMcpTokensPanel() { {/* MCP Tokens */}
-

{t('admin.mcpTokens.sectionTitle')}

-
+

{t('admin.mcpTokens.sectionTitle')}

+
{tokensLoading ? (
@@ -177,8 +174,8 @@ export default function AdminMcpTokensPanel() {
) : ( <> -
+
{t('admin.mcpTokens.tokenName')} {t('admin.mcpTokens.owner')} {t('admin.mcpTokens.created')} @@ -187,13 +184,12 @@ export default function AdminMcpTokensPanel() {
{tokens.map((token, i) => (
+ className={`grid grid-cols-[1fr_auto_auto_auto_auto] items-center gap-x-4 px-4 py-3 ${i < tokens.length - 1 ? 'border-b border-edge' : ''}`}>
-

{token.name}

+

{token.name}

{token.token_prefix}...

-
+
{token.username}
@@ -217,14 +213,14 @@ export default function AdminMcpTokensPanel() { {/* Revoke OAuth session modal */} {revokeConfirmId !== null && ( -
{ if (e.target === e.currentTarget) setRevokeConfirmId(null) }}> -
-

{t('admin.oauthSessions.revokeTitle')}

-

{t('admin.oauthSessions.revokeMessage')}

+
+

{t('admin.oauthSessions.revokeTitle')}

+

{t('admin.oauthSessions.revokeMessage')}

-

+

{t('admin.audit.showing', { count: entries.length, total })}

{loading && entries.length === 0 ? ( -
{t('common.loading')}
+
{t('common.loading')}
) : entries.length === 0 ? ( -
{t('admin.audit.empty')}
+
{t('admin.audit.empty')}
) : ( -
+
- - - - - - - + + + + + + + {entries.map((e) => ( - - - - - - - + + + + + + + ))} @@ -160,8 +159,7 @@ export default function AuditLogPanel({ serverTimezone }: AuditLogPanelProps): R type="button" disabled={loading} onClick={() => loadMore()} - className="text-sm font-medium underline-offset-2 hover:underline disabled:opacity-50" - style={{ color: 'var(--text-secondary)' }} + className="text-sm font-medium underline-offset-2 hover:underline disabled:opacity-50 text-content-secondary" > {t('admin.audit.loadMore')} diff --git a/client/src/components/Admin/BackupPanel.tsx b/client/src/components/Admin/BackupPanel.tsx index a049f8b9..6dc67c86 100644 --- a/client/src/components/Admin/BackupPanel.tsx +++ b/client/src/components/Admin/BackupPanel.tsx @@ -186,8 +186,8 @@ export default function BackupPanel() {
-

{t('backup.title')}

-

{t('backup.subtitle')}

+

{t('backup.title')}

+

{t('backup.subtitle')}

@@ -310,8 +310,8 @@ export default function BackupPanel() {
-

{t('backup.auto.title')}

-

{t('backup.auto.subtitle')}

+

{t('backup.auto.title')}

+

{t('backup.auto.subtitle')}

@@ -458,7 +458,8 @@ export default function BackupPanel() { {/* Restore Warning Modal */} {restoreConfirm && (
setRestoreConfirm(null)} >
{/* Red header */}
-
- +
+
-

+

{t('backup.restoreConfirmTitle')}

-

+

{restoreConfirm.filename}

@@ -505,7 +506,8 @@ export default function BackupPanel() { @@ -146,14 +146,14 @@ export default function DefaultUserSettingsTab(): React.ReactElement { }], []) if (!loaded) { - return

Loading…

+ return

Loading…

} const darkMode = defaults.dark_mode return (
-

+

{t('admin.defaultSettings.description')}

@@ -224,7 +224,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement { {/* Map Tile URL */}
-
{t('admin.audit.col.time')}{t('admin.audit.col.user')}{t('admin.audit.col.action')}{t('admin.audit.col.resource')}{t('admin.audit.col.ip')}{t('admin.audit.col.details')}
{t('admin.audit.col.time')}{t('admin.audit.col.user')}{t('admin.audit.col.action')}{t('admin.audit.col.resource')}{t('admin.audit.col.ip')}{t('admin.audit.col.details')}
{fmtTime(e.created_at)}{userLabel(e)}{e.action}{e.resource || '—'}{e.ip || '—'}{fmtDetails(e.details)}
{fmtTime(e.created_at)}{userLabel(e)}{e.action}{e.resource || '—'}{e.ip || '—'}{fmtDetails(e.details)}