From e69a2f05af46792c21c1e376ac1195e691375317 Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Thu, 3 Sep 2026 00:45:40 -0400 Subject: [PATCH] feat(client): define the neutral palette and switch to Geist The palette declared a brand green and six chart hues but never defined the neutrals, so MUI's defaults filled the gap: body text at 60% black, dividers at 12%, and background.default equal to background.paper. That is the "washed out" everything sat on - table cells render through text.secondary, and cards had no ground to sit on. - Opaque neutral ramp, biased slightly green so it sits with the brand. background.default is now off-white so paper separates from the page. - Semantic success/error/warning derived from the brand instead of Material's stock red/green/orange. Only `main` is set: `light` is consumed as a saturated colour by status dots, histogram bars and heatmap cells, so MUI must keep deriving it. - Dark mode gets the same treatment; it defined background and secondary but its text and divider were still MUI defaults. - Geist Variable, self-hosted via @fontsource-variable so air-gapped installs keep the typeface. Base size stays at 13px. - h1 700 / h2 600 against 400 body, and table headers 500 -> 600. Two weights was why everything read at the same visual weight. All contrast pairs pass WCAG AA in both themes (lowest 5.98:1). No component markup changed. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd --- client/package-lock.json | 10 ++++ client/package.json | 1 + .../src/Components/design-elements/Table.tsx | 2 +- client/src/Utils/Theme/Palette.ts | 54 +++++++++++++++++++ client/src/Utils/Theme/Theme.ts | 8 +-- client/src/main.tsx | 2 + 6 files changed, 73 insertions(+), 4 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 6cee968e3..629678180 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -11,6 +11,7 @@ "@csstools/css-tokenizer": "^3.0.4", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", + "@fontsource-variable/geist": "^5.3.0", "@hello-pangea/dnd": "^18.0.0", "@hookform/resolvers": "5.2.2", "@mui/lab": "7.0.0", @@ -950,6 +951,15 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fontsource-variable/geist": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/geist/-/geist-5.3.0.tgz", + "integrity": "sha512-j0m+vLQuG5XAYoHtGCVu0spvlGreR3EzpECUVzkFmI1mTVnAO38l/NEPDCFgZ177JxzYJCLSmTQibIiYPilGrA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "license": "BSD-3-Clause" diff --git a/client/package.json b/client/package.json index ce2e481ba..a26499805 100644 --- a/client/package.json +++ b/client/package.json @@ -21,6 +21,7 @@ "@csstools/css-tokenizer": "^3.0.4", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", + "@fontsource-variable/geist": "^5.3.0", "@hello-pangea/dnd": "^18.0.0", "@hookform/resolvers": "5.2.2", "@mui/lab": "7.0.0", diff --git a/client/src/Components/design-elements/Table.tsx b/client/src/Components/design-elements/Table.tsx index df0d52b16..9ef7dcee8 100644 --- a/client/src/Components/design-elements/Table.tsx +++ b/client/src/Components/design-elements/Table.tsx @@ -197,7 +197,7 @@ export function DataTable< "& :is(th)": { backgroundColor: theme.palette.background.paper, color: theme.palette.text.secondary, - fontWeight: 500, + fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.08em", padding: `${theme.spacing(SPACING.LG)} ${theme.spacing(LAYOUT.MD)}`, diff --git a/client/src/Utils/Theme/Palette.ts b/client/src/Utils/Theme/Palette.ts index 0d9168f8a..bfb9dda5d 100644 --- a/client/src/Utils/Theme/Palette.ts +++ b/client/src/Utils/Theme/Palette.ts @@ -18,6 +18,23 @@ export const colors = { gray700: "#313131", gray900: "#151518", gray850: "#1c1c21", + // Neutral ramp, biased slightly green so it sits with the brand rather than + // against it. Opaque values - alpha-black over white reads washed out. + ink900: "#101917", + ink600: "#55635C", + ink400: "#7C8983", + surface50: "#F6F8F7", + rule200: "#D9E1DD", + // Semantic colours derived from the brand rather than Material's defaults + successMain: "#0D6049", + errorMain: "#A02B24", + warningMain: "#8C5806", + inkDark900: "#ECEFED", + inkDark600: "#A3ADA8", + ruleDark: "#2C3532", + successDark: "#4BC49E", + errorDark: "#E8837A", + warningDark: "#E0A458", brandGreen: "#13715B", brandGreenLight: "#4DAF94", green200: "#ECF7F2", @@ -47,6 +64,28 @@ export const lightPalette = { secondary: { main: colors.gray200, }, + background: { + default: colors.surface50, + paper: "#FFFFFF", + }, + text: { + primary: colors.ink900, + secondary: colors.ink600, + disabled: colors.ink400, + }, + divider: colors.rule200, + // Only `main` is set. MUI derives `light`/`dark` from it, and `light` is + // consumed as a saturated colour - status dots, histogram bars, heatmap + // cells - so it must not be overridden with a pale tint. + success: { + main: colors.successMain, + }, + error: { + main: colors.errorMain, + }, + warning: { + main: colors.warningMain, + }, sidebar: { accent: colors.brandGreen, }, @@ -81,6 +120,21 @@ export const darkPalette = { default: colors.gray900, paper: colors.gray850, }, + text: { + primary: colors.inkDark900, + secondary: colors.inkDark600, + disabled: colors.ink400, + }, + divider: colors.ruleDark, + success: { + main: colors.successDark, + }, + error: { + main: colors.errorDark, + }, + warning: { + main: colors.warningDark, + }, sidebar: { accent: colors.brandGreenLight, }, diff --git a/client/src/Utils/Theme/Theme.ts b/client/src/Utils/Theme/Theme.ts index c63929a60..a0b1d75be 100644 --- a/client/src/Utils/Theme/Theme.ts +++ b/client/src/Utils/Theme/Theme.ts @@ -57,7 +57,7 @@ export type PaletteKey = { [K in keyof Theme["palette"]]: Theme["palette"][K] extends { main: any } ? K : never; }[keyof Theme["palette"]]; -const fontFamilyPrimary = "system-ui, sans-serif"; +const fontFamilyPrimary = '"Geist Variable", system-ui, sans-serif'; const fontFamilyMonospace = 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'; const shadow = @@ -85,11 +85,13 @@ export const theme = (mode: string, palette: any) => fontSize: typographyLevels.base, h1: { fontSize: typographyLevels.xxl, - fontWeight: 500, + fontWeight: 700, + letterSpacing: "-0.015em", }, h2: { fontSize: typographyLevels.l, - fontWeight: 400, + fontWeight: 600, + letterSpacing: "-0.01em", }, body1: { fontSize: typographyLevels.m, diff --git a/client/src/main.tsx b/client/src/main.tsx index 1f5d4d2ef..ca81c338c 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -1,5 +1,7 @@ import ReactDOM from "react-dom/client"; import App from "./App.jsx"; +// Self-hosted so the app keeps its typeface on air-gapped installs +import "@fontsource-variable/geist"; import "./index.css"; import { BrowserRouter as Router } from "react-router-dom"; import { Provider } from "react-redux";