diff --git a/.changeset/configurable-content-font-size.md b/.changeset/configurable-content-font-size.md
new file mode 100644
index 0000000000..6e12a975bb
--- /dev/null
+++ b/.changeset/configurable-content-font-size.md
@@ -0,0 +1,11 @@
+---
+'@hyperdx/app': minor
+---
+
+feat: add a content font size preference
+
+Small text in the log/trace table was not adjustable without browser zoom, which
+also shrinks the surrounding chrome. User preferences now carry a **Content font
+size** setting (small / medium / large) that scales the search results table,
+data tables, expanded row JSON, and chart axes, legends, and tooltips. Small is
+the default and matches the previous sizes, so nothing changes until you opt in.
diff --git a/packages/app/pages/_app.tsx b/packages/app/pages/_app.tsx
index fb64f6fd68..3e6d401f32 100644
--- a/packages/app/pages/_app.tsx
+++ b/packages/app/pages/_app.tsx
@@ -33,6 +33,7 @@ import { NextApiConfigResponseData } from '@/types';
import { ConfirmProvider } from '@/useConfirm';
import {
SystemColorSchemeScript,
+ useContentFontSize,
useResolvedColorScheme,
useUserPreferences,
} from '@/useUserPreferences';
@@ -98,6 +99,8 @@ function AppContent({
const { userPreferences } = useUserPreferences();
const resolvedColorScheme = useResolvedColorScheme();
const { themeName } = useAppTheme();
+ const { base: contentFontSize, compact: compactContentFontSize } =
+ useContentFontSize();
// ClickStack theme always uses Inter font - user preference is ignored
// HyperDX theme allows user to select font preference
@@ -115,6 +118,21 @@ function AppContent({
}
}, [effectiveFont]);
+ useEffect(() => {
+ // Single write point for the content font size preference; tables and
+ // chart CSS read these vars (see styles/app.scss for the defaults).
+ if (typeof document !== 'undefined') {
+ document.documentElement.style.setProperty(
+ '--hdx-content-font-size',
+ `${contentFontSize}px`,
+ );
+ document.documentElement.style.setProperty(
+ '--hdx-content-font-size-compact',
+ `${compactContentFontSize}px`,
+ );
+ }
+ }, [contentFontSize, compactContentFontSize]);
+
const getLayout = Component.getLayout ?? (page => page);
return (
diff --git a/packages/app/src/HDXMultiSeriesTableChart.module.scss b/packages/app/src/HDXMultiSeriesTableChart.module.scss
index bd8559a884..f5e3eecc6f 100644
--- a/packages/app/src/HDXMultiSeriesTableChart.module.scss
+++ b/packages/app/src/HDXMultiSeriesTableChart.module.scss
@@ -4,6 +4,10 @@
// .rowButtons pattern from LogTable.module.scss (lines 156-172),
// scoped down to a single icon. See HDX-4405.
+.tableWrapper {
+ font-size: var(--hdx-content-font-size);
+}
+
.tableHeader {
// Always-on 1px separator between the sticky header and the rows. An
// inset box-shadow rather than a border because the table sets
diff --git a/packages/app/src/HDXMultiSeriesTableChart.tsx b/packages/app/src/HDXMultiSeriesTableChart.tsx
index fb035d76ea..8211f473b7 100644
--- a/packages/app/src/HDXMultiSeriesTableChart.tsx
+++ b/packages/app/src/HDXMultiSeriesTableChart.tsx
@@ -408,7 +408,7 @@ export const Table = ({
return (
= 0.005 from 0.
const MAX_AXIS_MANTISSA = 2;
-/** Base width ceiling for a bare signed number - see MAX_AXIS_MANTISSA's comment. */
+/**
+ * Base width ceiling for a bare signed number - see MAX_AXIS_MANTISSA's
+ * comment. A character budget rather than a pixel one, which is why
+ * Y_AXIS_WIDTH scales with the content font size preference: the gutter has to
+ * grow with the tick font for this to keep holding at every setting.
+ */
const AXIS_CHAR_BUDGET = 5;
// Flat, not suffix-length-scaled - IBM Plex Mono is monospace, so a longer
@@ -1351,6 +1357,12 @@ export const MemoChart = memo(function MemoChart({
const _id = useId();
const id = _id.replace(/:/g, '');
+ // The y-axis width budget is expressed in characters (see MAX_AXIS_MANTISSA),
+ // so it has to grow with the tick font or the widest labels clip.
+ const { compact: axisTickFontSize, scale: contentFontScale } =
+ useContentFontSize();
+ const yAxisWidth = Math.round(Y_AXIS_WIDTH * contentFontScale);
+
// recharts sync group, scoped via context (see chartSync).
const syncId = useChartSyncId();
@@ -1585,14 +1597,14 @@ export const MemoChart = memo(function MemoChart({
if (graphResults.length !== 1) return undefined;
const drawableWidth = Math.max(
0,
- containerWidth - Y_AXIS_WIDTH - SINGLE_POINT_BAR_RIGHT_PADDING,
+ containerWidth - yAxisWidth - SINGLE_POINT_BAR_RIGHT_PADDING,
);
if (drawableWidth <= 0) return undefined;
return Math.max(
1,
Math.floor(drawableWidth * SINGLE_POINT_BAR_WIDTH_RATIO),
);
- }, [displayType, graphResults.length, containerWidth]);
+ }, [displayType, graphResults.length, containerWidth, yAxisWidth]);
const formatTime = useFormatTime();
const xTickFormatter = useCallback(
@@ -1932,9 +1944,9 @@ export const MemoChart = memo(function MemoChart({
}
return layoutAnnotations(coloredAnnotations, {
domain: xAxisDomain,
- plotWidth: Math.max(0, containerWidth - Y_AXIS_WIDTH),
+ plotWidth: Math.max(0, containerWidth - yAxisWidth),
});
- }, [coloredAnnotations, xAxisDomain, containerWidth]);
+ }, [coloredAnnotations, xAxisDomain, containerWidth, yAxisWidth]);
const [hoveredAnnotation, setHoveredAnnotation] =
useState(null);
@@ -1948,9 +1960,9 @@ export const MemoChart = memo(function MemoChart({
// Drawable width, so markers too close together share one label. Zero on
// the first paint (before ResponsiveContainer measures), which the
// renderer treats as "label everything".
- plotWidth: Math.max(0, containerWidth - Y_AXIS_WIDTH),
+ plotWidth: Math.max(0, containerWidth - yAxisWidth),
});
- }, [coloredAnnotations, xAxisDomain, containerWidth]);
+ }, [coloredAnnotations, xAxisDomain, containerWidth, yAxisWidth]);
return (
diff --git a/packages/app/src/UserPreferencesModal.tsx b/packages/app/src/UserPreferencesModal.tsx
index 1bb8e79674..e65df5d2f0 100644
--- a/packages/app/src/UserPreferencesModal.tsx
+++ b/packages/app/src/UserPreferencesModal.tsx
@@ -13,12 +13,17 @@ import {
} from '@mantine/core';
import { IconFlask } from '@tabler/icons-react';
-import { OPTIONS_FONTS } from './config/fonts';
+import {
+ isContentFontSize,
+ OPTIONS_CONTENT_FONT_SIZE,
+ OPTIONS_FONTS,
+} from './config/fonts';
import { useAppTheme } from './theme/ThemeProvider';
import { isValidThemeName, themes } from './theme';
import {
DEFAULT_ROW_CLICK_ACTION,
RowClickAction,
+ useContentFontSize,
UserPreferences,
useUserPreferences,
} from './useUserPreferences';
@@ -72,6 +77,7 @@ export const UserPreferencesModal = ({
onClose: () => void;
}) => {
const { userPreferences, setUserPreference } = useUserPreferences();
+ const { contentFontSize } = useContentFontSize();
const { themeName, setTheme, isDev } = useAppTheme();
return (
@@ -168,6 +174,23 @@ export const UserPreferencesModal = ({
/>
+
+
+
{/*
Brand Theme Selector - DEV MODE ONLY
diff --git a/packages/app/src/__tests__/useContentFontSize.test.tsx b/packages/app/src/__tests__/useContentFontSize.test.tsx
new file mode 100644
index 0000000000..871f7d78c5
--- /dev/null
+++ b/packages/app/src/__tests__/useContentFontSize.test.tsx
@@ -0,0 +1,110 @@
+import { Provider } from 'jotai';
+import { act, renderHook } from '@testing-library/react';
+
+import { CONTENT_FONT_SIZES } from '@/config/fonts';
+import { useContentFontSize, useUserPreferences } from '@/useUserPreferences';
+
+const STORAGE_KEY = 'hdx-user-preferences';
+
+const renderContentFontSize = () =>
+ renderHook(
+ () => ({
+ resolved: useContentFontSize(),
+ preferences: useUserPreferences(),
+ }),
+ { wrapper: Provider },
+ );
+
+describe('useContentFontSize', () => {
+ beforeEach(() => {
+ window.localStorage.clear();
+ });
+
+ // The `sm` scale is what every content surface had hardcoded before the
+ // preference existed, so it has to stay the default.
+ it('defaults to the small scale', () => {
+ const { result } = renderContentFontSize();
+
+ expect(CONTENT_FONT_SIZES.sm).toEqual({ base: 12, compact: 11 });
+ expect(result.current.resolved).toEqual({
+ contentFontSize: 'sm',
+ ...CONTENT_FONT_SIZES.sm,
+ scale: 1,
+ });
+ });
+
+ it('falls back to the default for preferences stored before the setting existed', () => {
+ window.localStorage.setItem(
+ STORAGE_KEY,
+ JSON.stringify({
+ isUTC: true,
+ timeFormat: '24h',
+ colorMode: 'dark',
+ font: 'Inter',
+ }),
+ );
+
+ const { result } = renderContentFontSize();
+
+ expect(result.current.resolved.contentFontSize).toBe('sm');
+ });
+
+ it('loads a non-default preference saved in a previous session', () => {
+ window.localStorage.setItem(
+ STORAGE_KEY,
+ JSON.stringify({
+ isUTC: false,
+ timeFormat: '12h',
+ colorMode: 'dark',
+ font: 'IBM Plex Mono',
+ contentFontSize: 'md',
+ }),
+ );
+
+ const { result } = renderContentFontSize();
+
+ expect(result.current.resolved).toEqual({
+ contentFontSize: 'md',
+ ...CONTENT_FONT_SIZES.md,
+ scale: CONTENT_FONT_SIZES.md.base / CONTENT_FONT_SIZES.sm.base,
+ });
+ });
+
+ it('falls back to the default when the stored size is not one we ship', () => {
+ window.localStorage.setItem(
+ STORAGE_KEY,
+ JSON.stringify({
+ isUTC: false,
+ timeFormat: '12h',
+ colorMode: 'dark',
+ font: 'IBM Plex Mono',
+ contentFontSize: 'xl',
+ }),
+ );
+
+ const { result } = renderContentFontSize();
+
+ expect(result.current.resolved).toEqual({
+ contentFontSize: 'sm',
+ ...CONTENT_FONT_SIZES.sm,
+ scale: 1,
+ });
+ });
+
+ it('resolves the stored preference', () => {
+ const { result } = renderContentFontSize();
+
+ act(() =>
+ result.current.preferences.setUserPreference({ contentFontSize: 'lg' }),
+ );
+
+ expect(result.current.resolved).toEqual({
+ contentFontSize: 'lg',
+ ...CONTENT_FONT_SIZES.lg,
+ scale: CONTENT_FONT_SIZES.lg.base / CONTENT_FONT_SIZES.sm.base,
+ });
+ expect(
+ JSON.parse(window.localStorage.getItem(STORAGE_KEY) ?? '{}'),
+ ).toEqual(expect.objectContaining({ contentFontSize: 'lg' }));
+ });
+});
diff --git a/packages/app/src/components/DBBarChart.tsx b/packages/app/src/components/DBBarChart.tsx
index dcbd026378..6bdfbf0089 100644
--- a/packages/app/src/components/DBBarChart.tsx
+++ b/packages/app/src/components/DBBarChart.tsx
@@ -12,6 +12,7 @@ import {
import { Flex } from '@mantine/core';
import type { NumberFormat } from '@/types';
+import { useContentFontSize } from '@/useUserPreferences';
import { formatNumber } from '@/utils';
import {
@@ -24,6 +25,7 @@ import { ChartTooltipContainer, ChartTooltipItem } from './charts/ChartTooltip';
const MAX_BAR_LABEL_LENGTH = 14;
const BAR_LABEL_AXIS_HEIGHT = 80; // increased height to accommodate rotated + truncated labels
+const Y_AXIS_WIDTH = 40;
const truncateBarLabel = (value: string) =>
value.length > MAX_BAR_LABEL_LENGTH
@@ -71,6 +73,14 @@ export const DBBarChart = (props: CategoricalChartProps) => {
chartData,
responseFormatError,
} = useCategoricalChart(props);
+ // Both axis allocations are character budgets at the default tick font, so
+ // they scale with it rather than clipping the labels.
+ const { base: axisTickFontSize, scale: contentFontScale } =
+ useContentFontSize();
+ const barLabelAxisHeight = Math.round(
+ BAR_LABEL_AXIS_HEIGHT * contentFontScale,
+ );
+ const yAxisWidth = Math.round(Y_AXIS_WIDTH * contentFontScale);
return (
@@ -113,12 +123,15 @@ export const DBBarChart = (props: CategoricalChartProps) => {
interval={0}
angle={-45}
textAnchor="end"
- height={BAR_LABEL_AXIS_HEIGHT}
+ height={barLabelAxisHeight}
tickFormatter={truncateBarLabel}
- tick={{ fontSize: 12, fontFamily: 'IBM Plex Mono, monospace' }}
+ tick={{
+ fontSize: axisTickFontSize,
+ fontFamily: 'IBM Plex Mono, monospace',
+ }}
/>
resolvedNumberFormat
@@ -128,7 +141,10 @@ export const DBBarChart = (props: CategoricalChartProps) => {
compactDisplay: 'short',
}).format(value)
}
- tick={{ fontSize: 12, fontFamily: 'IBM Plex Mono, monospace' }}
+ tick={{
+ fontSize: axisTickFontSize,
+ fontFamily: 'IBM Plex Mono, monospace',
+ }}
/>
{chartData.map(entry => (
diff --git a/packages/app/src/components/DBHistogramChart.tsx b/packages/app/src/components/DBHistogramChart.tsx
index 2244461c4a..0e8ffa0e7c 100644
--- a/packages/app/src/components/DBHistogramChart.tsx
+++ b/packages/app/src/components/DBHistogramChart.tsx
@@ -17,6 +17,7 @@ import { buildMVDateRangeIndicator, INTEGER_NUMBER_FORMAT } from '@/ChartUtils';
import { useQueriedChartConfig } from '@/hooks/useChartConfig';
import { useMVOptimizationExplanation } from '@/hooks/useMVOptimizationExplanation';
import { useSource } from '@/source';
+import { useContentFontSize } from '@/useUserPreferences';
import { getColorFromCSSToken } from '@/utils';
import ChartContainer from './charts/ChartContainer';
@@ -29,6 +30,8 @@ import MVOptimizationIndicator from './MaterializedViews/MVOptimizationIndicator
/** First categorical series hue (`chart-blue`). Exported for unit tests. */
export const HISTOGRAM_BAR_COLOR = getColorFromCSSToken('chart-blue');
+const Y_AXIS_WIDTH = 35;
+
/**
* Normalize a chart click's `activeIndex` to a real, in-range bar index.
* Returns the integer index for a number or non-empty numeric string, or
@@ -71,6 +74,11 @@ function HistogramChart({
// tooltip is forced active on that bar via the controlled `active` +
// `defaultIndex` props below; `undefined` lets the tooltip follow hover.
const [pinnedIndex, setPinnedIndex] = useState(undefined);
+ // The axis allocation is a character budget at the default tick font, so it
+ // scales with it rather than clipping the labels.
+ const { base: axisTickFontSize, scale: contentFontScale } =
+ useContentFontSize();
+ const yAxisWidth = Math.round(Y_AXIS_WIDTH * contentFontScale);
useHotkeys(['esc'], () => {
setPinnedIndex(undefined);
@@ -122,10 +130,13 @@ function HistogramChart({
}).format(value)
}
// minTickGap={50}
- tick={{ fontSize: 12, fontFamily: 'IBM Plex Mono, monospace' }}
+ tick={{
+ fontSize: axisTickFontSize,
+ fontFamily: 'IBM Plex Mono, monospace',
+ }}
/>
new Intl.NumberFormat('en-US', {
@@ -133,7 +144,10 @@ function HistogramChart({
compactDisplay: 'short',
}).format(value)
}
- tick={{ fontSize: 12, fontFamily: 'IBM Plex Mono, monospace' }}
+ tick={{
+ fontSize: axisTickFontSize,
+ fontFamily: 'IBM Plex Mono, monospace',
+ }}
/>
;
logLevelColumn?: string;
columnSizeStorage: Record;
+ /**
+ * Content font size ratio. Only the defaults scale — a width the user
+ * dragged to is what they asked for at any font size.
+ */
+ contentFontScale: number;
},
): number {
const columnId = opts.aliasMap?.[column] ? `"${column}"` : column;
const stored = opts.columnSizeStorage[columnId];
if (stored != null) return stored;
+ const scaled = (px: number) => Math.round(px * opts.contentFontScale);
const jsType = opts.columnTypeMap.get(column)?._type;
- if (jsType === JSDataType.Date) return 170;
- if (column === opts.logLevelColumn) return 115;
- return 160;
+ if (jsType === JSDataType.Date) return scaled(170);
+ if (column === opts.logLevelColumn) return scaled(115);
+ return scaled(160);
}
function inferLogLevelColumn(rows: Record[]) {
@@ -458,6 +465,7 @@ export const RawLogTable = memo(
const {
userPreferences: { isUTC, rowClickAction },
} = useUserPreferences();
+ const { scale: contentFontScale } = useContentFontSize();
// The ClickHouse dashboard's slow-query list has no side panel to open, so
// inline expansion is the only thing a row click can do there.
@@ -567,8 +575,20 @@ export const RawLogTable = memo(
});
const columnSizeOpts = useMemo(
- () => ({ aliasMap, columnTypeMap, logLevelColumn, columnSizeStorage }),
- [aliasMap, columnTypeMap, logLevelColumn, columnSizeStorage],
+ () => ({
+ aliasMap,
+ columnTypeMap,
+ logLevelColumn,
+ columnSizeStorage,
+ contentFontScale,
+ }),
+ [
+ aliasMap,
+ columnTypeMap,
+ logLevelColumn,
+ columnSizeStorage,
+ contentFontScale,
+ ],
);
const leadingColumnsWidth =
diff --git a/packages/app/src/components/DBTable/TableHeader.tsx b/packages/app/src/components/DBTable/TableHeader.tsx
index e96aaedfc7..855bf04862 100644
--- a/packages/app/src/components/DBTable/TableHeader.tsx
+++ b/packages/app/src/components/DBTable/TableHeader.tsx
@@ -36,7 +36,7 @@ export default function TableHeader({
>
{!header.column.getCanSort() ? (
-
+
{flexRender(header.column.columnDef.header, header.getContext())}
) : (
@@ -48,7 +48,7 @@ export default function TableHeader({
>
<>
{header.isPlaceholder ? null : (
-
+
{flexRender(
header.column.columnDef.header,
header.getContext(),
diff --git a/packages/app/src/components/HyperJson.module.scss b/packages/app/src/components/HyperJson.module.scss
index d0509c8589..80d10d549e 100644
--- a/packages/app/src/components/HyperJson.module.scss
+++ b/packages/app/src/components/HyperJson.module.scss
@@ -4,7 +4,7 @@
width: 100%;
flex-direction: column;
padding: var(--mantine-spacing-xs);
- font-size: 12px;
+ font-size: var(--hdx-content-font-size);
font-family: var(--font-ibm-plex-mono);
}
@@ -232,12 +232,12 @@
.object {
color: var(--color-json-object);
- font-size: 11px;
+ font-size: var(--hdx-content-font-size-compact);
}
.array {
color: var(--color-json-array);
- font-size: 11px;
+ font-size: var(--hdx-content-font-size-compact);
}
.expandMoreProps {
diff --git a/packages/app/src/components/Table.module.scss b/packages/app/src/components/Table.module.scss
index 9c99f3460c..0cbc21699a 100644
--- a/packages/app/src/components/Table.module.scss
+++ b/packages/app/src/components/Table.module.scss
@@ -40,7 +40,7 @@ $horizontalPadding: 12px;
}
td {
- font-size: 12px;
+ font-size: var(--hdx-content-font-size);
padding: $normalVerticalPadding $horizontalPadding;
word-wrap: break-word;
word-break: break-all;
@@ -115,7 +115,7 @@ $horizontalPadding: 12px;
border: 1px solid var(--color-border);
color: var(--color-text);
text-align: center;
- font-size: 11px;
+ font-size: var(--hdx-content-font-size-compact);
&:hover {
background-color: var(--color-bg-field-highlighted);
diff --git a/packages/app/src/config/fonts.ts b/packages/app/src/config/fonts.ts
index 422d501afb..015dee8345 100644
--- a/packages/app/src/config/fonts.ts
+++ b/packages/app/src/config/fonts.ts
@@ -50,3 +50,32 @@ export const OPTIONS_FONTS = [
'Inter',
'Roboto',
];
+
+export type ContentFontSize = 'sm' | 'md' | 'lg';
+
+/**
+ * Font sizes (px) for content surfaces: tables, chart axes, legends, tooltips.
+ * `base` is body text, `compact` the secondary size used for chart chrome.
+ * `sm` reproduces the sizes that were hardcoded before this was configurable,
+ * so it must stay the default.
+ */
+export const CONTENT_FONT_SIZES: Record<
+ ContentFontSize,
+ { base: number; compact: number }
+> = {
+ sm: { base: 12, compact: 11 },
+ md: { base: 14, compact: 13 },
+ lg: { base: 16, compact: 15 },
+};
+
+export const DEFAULT_CONTENT_FONT_SIZE: ContentFontSize = 'sm';
+
+export function isContentFontSize(value: string): value is ContentFontSize {
+ return value in CONTENT_FONT_SIZES;
+}
+
+export const OPTIONS_CONTENT_FONT_SIZE = [
+ { label: 'Small', value: 'sm' },
+ { label: 'Medium', value: 'md' },
+ { label: 'Large', value: 'lg' },
+];
diff --git a/packages/app/src/useUserPreferences.tsx b/packages/app/src/useUserPreferences.tsx
index 74ef219fbc..e91510ad6e 100644
--- a/packages/app/src/useUserPreferences.tsx
+++ b/packages/app/src/useUserPreferences.tsx
@@ -3,6 +3,13 @@ import produce from 'immer';
import { useAtom } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
+import {
+ CONTENT_FONT_SIZES,
+ type ContentFontSize,
+ DEFAULT_CONTENT_FONT_SIZE,
+ isContentFontSize,
+} from '@/config/fonts';
+
type ColorModePreference = 'light' | 'dark' | 'system';
/** What clicking the body of a search result row does. */
@@ -17,6 +24,11 @@ export type UserPreferences = {
colorMode: ColorModePreference;
font: 'IBM Plex Mono' | 'Roboto Mono' | 'Inter' | 'Roboto';
expandSidebarHeader?: boolean;
+ /**
+ * Font size for content surfaces (tables, charts). Optional so preferences
+ * saved before it existed keep working; read it via `useContentFontSize`.
+ */
+ contentFontSize?: ContentFontSize;
/**
* Unset until the user opts in. Stored preferences that predate this field are
* returned as-is rather than merged with `DEFAULT_PREFERENCES`, so readers must
@@ -228,6 +240,35 @@ export const useUserPreferences = () => {
return { userPreferences, setUserPreference };
};
+/**
+ * Resolved content font size. CSS surfaces should read the
+ * `--hdx-content-font-size` / `--hdx-content-font-size-compact` custom
+ * properties set from this in `_app.tsx`; the numbers are for the charts,
+ * which take numeric `fontSize` props rather than CSS.
+ */
+export const useContentFontSize = () => {
+ const {
+ userPreferences: { contentFontSize },
+ } = useUserPreferences();
+
+ // The guard looks redundant against the declared type, but the value comes
+ // from localStorage: a hand-edited or stale blob can carry a size we no
+ // longer ship, and indexing CONTENT_FONT_SIZES with it would be undefined.
+ const size =
+ contentFontSize && isContentFontSize(contentFontSize)
+ ? contentFontSize
+ : DEFAULT_CONTENT_FONT_SIZE;
+ const { base, compact } = CONTENT_FONT_SIZES[size];
+
+ return {
+ contentFontSize: size,
+ base,
+ compact,
+ /** Ratio against the default, for px sizing that must grow with the text. */
+ scale: base / CONTENT_FONT_SIZES[DEFAULT_CONTENT_FONT_SIZE].base,
+ };
+};
+
/**
* Inline script that runs before React to set data-mantine-color-scheme from
* user preference (light/dark/system). Prevents flash when preference is "system".
diff --git a/packages/app/styles/HDXLineChart.module.scss b/packages/app/styles/HDXLineChart.module.scss
index 1bf88cdd5c..1c2817f345 100644
--- a/packages/app/styles/HDXLineChart.module.scss
+++ b/packages/app/styles/HDXLineChart.module.scss
@@ -20,7 +20,7 @@
}
.legendItem {
- font-size: 11px;
+ font-size: var(--hdx-content-font-size-compact);
margin-right: 8px;
margin-bottom: 4px;
display: flex;
@@ -58,7 +58,7 @@
background-color: var(--color-bg-surface);
border: 1px solid var(--color-border);
border-radius: 2px;
- font-size: 11px;
+ font-size: var(--hdx-content-font-size-compact);
// Fixed width so hover and pinned tooltips match and don't reflow when a row's
// content changes (e.g. the pinned copy icon swapping to a check).
diff --git a/packages/app/styles/LogTable.module.scss b/packages/app/styles/LogTable.module.scss
index bec56a301b..684206a6e9 100644
--- a/packages/app/styles/LogTable.module.scss
+++ b/packages/app/styles/LogTable.module.scss
@@ -3,7 +3,7 @@ $button-height: 18px;
.tableWrapper {
overflow: auto;
height: 100%;
- font-size: var(--mantine-font-size-xs);
+ font-size: var(--hdx-content-font-size);
/* CSS custom properties for variant support */
--log-table-bg: var(--color-bg-body);
diff --git a/packages/app/styles/app.scss b/packages/app/styles/app.scss
index 807ab1d4cf..57a4a590ef 100644
--- a/packages/app/styles/app.scss
+++ b/packages/app/styles/app.scss
@@ -30,6 +30,12 @@
--mantine-moz-font-smoothing: inherit;
--app-font-family: var(--font-inter);
+
+ // Content density, overridden on from the `contentFontSize` user
+ // preference. These defaults must match CONTENT_FONT_SIZES.sm so the
+ // pre-hydration render matches the default preference.
+ --hdx-content-font-size: 12px;
+ --hdx-content-font-size-compact: 11px;
}
[data-mantine-color-scheme='dark'] {
@@ -270,7 +276,7 @@ button:focus-visible {
}
.recharts-legend-item {
- font-size: 0.75rem;
+ font-size: var(--hdx-content-font-size);
}
.recharts-tooltip-cursor {