Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Migrate UI styles to Zen theme tokens and preserve brand colors
Mike Cao9ff1ecb6ddfb
diff --git a/src/app/(main)/SideNav.tsx b/src/app/(main)/SideNav.tsxindex 360c0c1dd..0a0e10158 100644--- a/src/app/(main)/SideNav.tsx+++ b/src/app/(main)/SideNav.tsx@@ -71,7 +71,7 @@ export function SideNav(props: any) {return (<Column{...props}- backgroundColor="surface-base"+ backgroundColor="surface"borderborderRadiuspadding="2"diff --git a/src/app/(main)/boards/BoardEntityBadge.tsx b/src/app/(main)/boards/BoardEntityBadge.tsxindex 70d4784f8..7c05d0f19 100644--- a/src/app/(main)/boards/BoardEntityBadge.tsx+++ b/src/app/(main)/boards/BoardEntityBadge.tsx@@ -13,7 +13,7 @@ export function BoardEntityBadge({domain?: string;}) {return (- <Row padding borderRadius="full" backgroundColor="surface-base" border gap="2">+ <Row padding borderRadius="full" backgroundColor="surface" border gap="2"><Icon>{type === 'pixel' ? <Grid2x2 /> : type === 'link' ? <Link /> : <Favicon domain={domain} />}</Icon>diff --git a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.cssindex 15e3ae2bb..aaca6d766 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css+++ b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css@@ -12,7 +12,7 @@.railDivider {width: 1px;height: 100%;- background: var(--zen-gray-300, #d1d5db);+ background: var(--zen-palette-300, #d1d5db);justify-self: center;}@@ -74,7 +74,7 @@.mobileSelectedPageButton {width: 100%;text-align: left;- border: 1px solid var(--zen-border-default);+ border: 1px solid var(--zen-border);background: var(--zen-surface-raised);border-radius: 8px;padding: 10px 12px;@@ -109,7 +109,7 @@padding: 4px 10px;border-radius: 999px;background: var(--zen-surface-raised);- border: 1px solid var(--zen-border-default);+ border: 1px solid var(--zen-border);white-space: nowrap;}@@ -175,7 +175,7 @@.canvas {position: relative;overflow: hidden;- border: 1px solid var(--zen-border-default);+ border: 1px solid var(--zen-border);border-radius: 8px;background: var(--zen-surface-sunken);flex: 0 0 auto;@@ -224,7 +224,7 @@width: 100%;height: 100%;border: 0;- background: var(--zen-surface-base);+ background: var(--zen-surface);overflow: hidden;pointer-events: none;}diff --git a/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.module.css b/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.module.cssindex 45571e81a..f2752fbfd 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.module.css+++ b/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.module.css@@ -43,7 +43,7 @@.dropoff {font-weight: 600;- color: var(--zen-text-muted);+ color: var(--zen-fg-muted);background: var(--zen-surface-sunken);padding: 4px 8px;border-radius: 5px;@@ -58,7 +58,7 @@height: 50px;font-size: 16px;font-weight: 700;- color: var(--zen-surface-base);+ color: var(--zen-surface);background: var(--zen-surface-inverted);z-index: 1;margin: 0 auto 20px;@@ -100,22 +100,22 @@}.node.selected {- color: var(--zen-surface-base);+ color: var(--zen-surface);background: var(--zen-surface-inverted);}.node.active {- color: var(--zen-primary-foreground);+ color: var(--zen-primary-fg);background: var(--zen-primary);}.node.selected .count {- color: var(--zen-surface-base);+ color: var(--zen-surface);background: var(--zen-surface-inverted);}.node.selected.active .count {- color: var(--zen-primary-foreground);+ color: var(--zen-primary-fg);background: var(--zen-primary);}@@ -212,7 +212,7 @@position: absolute;border-radius: 100%;border: 3px solid var(--journey-line-color);- background: var(--zen-surface-base);+ background: var(--zen-surface);width: 14px;height: 14px;}diff --git a/src/app/(main)/websites/[websiteId]/(reports)/performance/Performance.module.css b/src/app/(main)/websites/[websiteId]/(reports)/performance/Performance.module.cssindex c1a4e64af..8ccfeadd7 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/performance/Performance.module.css+++ b/src/app/(main)/websites/[websiteId]/(reports)/performance/Performance.module.css@@ -1,3 +1,3 @@.sampleCount {- color: var(--zen-text-muted);+ color: var(--zen-fg-muted);}diff --git a/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayer.tsx b/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayer.tsxindex 4d7b5f4fa..047656c2f 100644--- a/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayer.tsx+++ b/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayer.tsx@@ -29,8 +29,8 @@ export function ReplayPlayer({ events }: { events: any[] }) {const playerRef = useRef<any>(null);const [playerError, setPlayerError] = useState(false);const [availableWidth, setAvailableWidth] = useState(0);- const [viewportHeight, setViewportHeight] = useState(- () => (typeof window !== 'undefined' ? window.innerHeight : 0),+ const [viewportHeight, setViewportHeight] = useState(() =>+ typeof window !== 'undefined' ? window.innerHeight : 0,);const { isMobile, isPhone } = useMobile();const replayEvents = useMemo(() => getReplayPlayerEvents(events), [events]);@@ -42,9 +42,7 @@ export function ReplayPlayer({ events }: { events: any[] }) {const replayAspectRatio = replayViewport? replayViewport.height / replayViewport.width: DEFAULT_REPLAY_ASPECT_RATIO;- const isPortraitReplay = replayViewport- ? replayViewport.height > replayViewport.width- : false;+ const isPortraitReplay = replayViewport ? replayViewport.height > replayViewport.width : false;const fittedAspectRatio = isPortraitReplay? Math.min(Math.max(replayAspectRatio, DEFAULT_REPLAY_ASPECT_RATIO), 2.25): Math.min(Math.max(replayAspectRatio, DEFAULT_REPLAY_ASPECT_RATIO), 1.5);@@ -161,7 +159,10 @@ export function ReplayPlayer({ events }: { events: any[] }) {return (<Column alignItems="center" width="100%">- <div ref={playerWrapperRef} style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>+ <div+ ref={playerWrapperRef}+ style={{ width: '100%', display: 'flex', justifyContent: 'center' }}+ ><divstyle={{width: playerWidth,@@ -169,7 +170,7 @@ export function ReplayPlayer({ events }: { events: any[] }) {height: showUnavailable ? playerHeight : playerOuterHeight,overflow: 'hidden',borderRadius: '8px',- border: '1px solid var(--zen-border-default)',+ border: '1px solid var(--zen-border)',background: 'var(--zen-surface-sunken)',}}>diff --git a/src/app/global.css b/src/app/global.cssindex a5e336e4e..7e883d7f9 100644--- a/src/app/global.css+++ b/src/app/global.css@@ -1,19 +1,34 @@:root {--zen-font-family: var(--font-inter), sans-serif;+}++/* Preserve the brand accent when Zen applies its light or dark theme tokens. */+:root,+[data-theme="light"],+[data-theme="dark"],+.dark {--zen-primary: oklch(62.3% 0.214 259.815);- --zen-primary-foreground: oklch(98.5% 0 0);+ --zen-primary-fg: oklch(98.5% 0 0);+}++/* Zen's rem-based typography and spacing assume the browser's default root size. */+html {+ font-size: 100%;}html,body {font-family: var(--zen-font-family), sans-serif;- font-size: 14px;- color: var(--zen-text-primary);+ color: var(--zen-fg);background-color: var(--zen-surface-raised);width: 100%;min-height: 100vh;}+body {+ font-size: 0.875rem;+}+html[style*="padding-right"] {padding-right: 0 !important;}@@ -29,11 +44,11 @@ textarea:is(:-webkit-autofill, :autofill):focus,select:is(:-webkit-autofill, :autofill),select:is(:-webkit-autofill, :autofill):hover,select:is(:-webkit-autofill, :autofill):focus {- color: var(--zen-text-primary) !important;- caret-color: var(--zen-text-primary);- box-shadow: 0 0 0 1000px var(--zen-surface-base) inset !important;- -webkit-box-shadow: 0 0 0 1000px var(--zen-surface-base) inset !important;- -webkit-text-fill-color: var(--zen-text-primary) !important;+ color: var(--zen-fg) !important;+ caret-color: var(--zen-fg);+ box-shadow: 0 0 0 1000px var(--zen-surface) inset !important;+ -webkit-box-shadow: 0 0 0 1000px var(--zen-surface) inset !important;+ -webkit-text-fill-color: var(--zen-fg) !important;transition:background-color 5000s ease-in-out 0s,color 5000s ease-in-out 0s;diff --git a/src/components/common/Badge.module.css b/src/components/common/Badge.module.cssindex 27e48387e..f2e26a003 100644--- a/src/components/common/Badge.module.css+++ b/src/components/common/Badge.module.css@@ -47,12 +47,12 @@}.gray {- color: var(--zen-text-muted);+ color: var(--zen-fg-muted);background: var(--zen-surface-sunken);}.gray .dot {- background: var(--zen-text-muted);+ background: var(--zen-fg-muted);}:global([data-theme="dark"]) .good {diff --git a/src/components/common/OverlayScrollArea.module.css b/src/components/common/OverlayScrollArea.module.cssindex cef44b334..0ad3ce66f 100644--- a/src/components/common/OverlayScrollArea.module.css+++ b/src/components/common/OverlayScrollArea.module.css@@ -1,7 +1,7 @@.root {- --overlay-scrollbar-track: var(--zen-gray-50);- --overlay-scrollbar-thumb: var(--zen-gray-300);- --overlay-scrollbar-thumb-hover: var(--zen-gray-400);+ --overlay-scrollbar-track: var(--zen-palette-50);+ --overlay-scrollbar-thumb: var(--zen-palette-300);+ --overlay-scrollbar-thumb-hover: var(--zen-palette-400);--overlay-scrollbar-viewport-padding-right: 0px;--overlay-scrollbar-vertical-margin-right: 2px;}@@ -44,8 +44,8 @@content: "";}-[data-theme='dark'] .root {- --overlay-scrollbar-track: var(--zen-gray-800);- --overlay-scrollbar-thumb: var(--zen-gray-600);- --overlay-scrollbar-thumb-hover: var(--zen-gray-500);+[data-theme="dark"] .root {+ --overlay-scrollbar-track: var(--zen-palette-800);+ --overlay-scrollbar-thumb: var(--zen-palette-600);+ --overlay-scrollbar-thumb-hover: var(--zen-palette-500);}diff --git a/src/components/common/Panel.tsx b/src/components/common/Panel.tsxindex 182027f91..1c6d9406b 100644--- a/src/components/common/Panel.tsx+++ b/src/components/common/Panel.tsx@@ -54,7 +54,7 @@ export function Panel({paddingX={{ base: '3', md: '6' }}borderborderRadius- backgroundColor="surface-base"+ backgroundColor="surface"position="relative"gap{...props}diff --git a/src/components/common/SortableLabel.tsx b/src/components/common/SortableLabel.tsxindex c8ad41ba4..a90585afc 100644--- a/src/components/common/SortableLabel.tsx+++ b/src/components/common/SortableLabel.tsx@@ -18,7 +18,7 @@ export function SortableLabel({ label, sortKey, defaultDirection = 'asc' }: Sortconst isActive = query.orderBy === sortKey;const isDescending = query.sortDescending === 'true';const direction = isActive ? (isDescending ? 'desc' : 'asc') : undefined;- const activeColor = 'var(--zen-text-primary)';+ const activeColor = 'var(--zen-fg)';const getNextDirection = (): SortDirection => {if (!isActive) {@@ -55,7 +55,7 @@ export function SortableLabel({ label, sortKey, defaultDirection = 'asc' }: SortflexDirection: 'column',gap: 0,lineHeight: 0,- color: 'var(--zen-text-muted)',+ color: 'var(--zen-fg-muted)',opacity: 0.8,}}>diff --git a/src/components/metrics/ChangeLabel.tsx b/src/components/metrics/ChangeLabel.tsxindex fbd0fc1e3..23d484a60 100644--- a/src/components/metrics/ChangeLabel.tsx+++ b/src/components/metrics/ChangeLabel.tsx@@ -12,7 +12,7 @@ const STYLES = {background: `var(--zen-status-error-bg)`,},neutral: {- color: `var(--zen-text-muted)`,+ color: `var(--zen-fg-muted)`,background: `var(--zen-surface-raised)`,},};diff --git a/src/components/metrics/MetricCard.tsx b/src/components/metrics/MetricCard.tsxindex f7bbb0a6f..b926453be 100644--- a/src/components/metrics/MetricCard.tsx+++ b/src/components/metrics/MetricCard.tsx@@ -51,7 +51,7 @@ export const MetricCard = ({paddingX="6"paddingY="4"borderRadius- backgroundColor="surface-base"+ backgroundColor="surface"bordergap="4">diff --git a/src/components/metrics/PerformanceCard.module.css b/src/components/metrics/PerformanceCard.module.cssindex 470ddb5ea..61eb56a36 100644--- a/src/components/metrics/PerformanceCard.module.css+++ b/src/components/metrics/PerformanceCard.module.css@@ -3,9 +3,9 @@}.card:hover {- box-shadow: 0 0 0 1px var(--zen-text-primary);+ box-shadow: 0 0 0 1px var(--zen-fg);}.card.selected {- box-shadow: 0 0 0 1px var(--zen-text-primary);+ box-shadow: 0 0 0 1px var(--zen-fg);}diff --git a/src/components/metrics/PerformanceCard.tsx b/src/components/metrics/PerformanceCard.tsxindex 0851526d7..5422dd35b 100644--- a/src/components/metrics/PerformanceCard.tsx+++ b/src/components/metrics/PerformanceCard.tsx@@ -61,7 +61,7 @@ export const PerformanceCard = ({paddingX="6"paddingY="4"borderRadius- backgroundColor="surface-base"+ backgroundColor="surface"bordergap="4"onClick={onClick}diff --git a/src/components/property-data/PropertyDateChart.tsx b/src/components/property-data/PropertyDateChart.tsxindex 6d2cc25f2..9a768fc8f 100644--- a/src/components/property-data/PropertyDateChart.tsx+++ b/src/components/property-data/PropertyDateChart.tsx@@ -55,7 +55,7 @@ function InsightCard({ label, value, hint }: { label: string; value: string; hinpaddingX="6"paddingY="4"borderRadius- backgroundColor="surface-base"+ backgroundColor="surface"bordergap="2"height="100%"diff --git a/src/components/share/SharedSharesTable.tsx b/src/components/share/SharedSharesTable.tsxindex 6231dbbc9..b46dca9d8 100644--- a/src/components/share/SharedSharesTable.tsx+++ b/src/components/share/SharedSharesTable.tsx@@ -5,7 +5,7 @@ import { useConfig, useMessages, useMobile } from '@/components/hooks';import { ExternalLink } from '@/components/icons';const desktopGridTemplateColumns = 'minmax(180px, 1fr) minmax(0, 2fr) auto';-const rowBorder = '1px solid var(--zen-border-default)';+const rowBorder = '1px solid var(--zen-border)';export interface ShareRow {id: string;