From 3c3959c38be6e9e14e58bf340d23e8cabab2bac1 Mon Sep 17 00:00:00 2001 From: Mohaimen Hasan Date: Wed, 25 Nov 2026 10:30:54 +0600 Subject: [PATCH] DOne --- CLAUDE.md | 15 +++++++++++++++ HRM.UI/appsettings.json | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 699b220..0527700 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -744,6 +744,21 @@ One trap it documents: custom properties declared on `:host` do **not** resolve portals to the document root (`appendTo: 'root'` — dropdown/calendar popups). Use SCSS variables that compile to literals for those blocks, not `var(--…)`. +### GoHR theme (runtime, per deployment) + +The app's colours and font are chosen **at runtime, per deployment**, not at build time. +`src/main.ts` calls `applyGoHrTheme()` ([src/app/gohr-theme/theme-loader.ts](HRM.UI/ClientApp/src/app/gohr-theme/theme-loader.ts)), +which reads `src/assets/gohr-theme/theme-settings.json`, `palettes.json` and `fonts.json` and writes the +chosen palette onto `:root` as `--gh-*` custom properties (derived hover/ring/menu shades and contrast text +included). Every themed rule lives in `src/styles/theme/gohr-theme.scss` and reads those variables; if a +JSON file is missing, the defaults compiled into that SCSS stay in place (the loader never throws). + +- To change a deployment's look, edit only `theme-settings.json` (`palette`, `font`, `fontSize`, `menu`, + `topbar`, `background` — the file's `_help` block lists the allowed values). On a server that is + `wwwroot/assets/gohr-theme/theme-settings.json`; no rebuild, just a browser reload. +- In component styles use the `--gh-*` variables rather than hardcoded colours, so the screen follows the + palette. They are set on `:root`, so unlike `:host` properties they do resolve inside Kendo popups. + ## Adding a feature: the full vertical slice A typical feature commit touches, in order: diff --git a/HRM.UI/appsettings.json b/HRM.UI/appsettings.json index b164580..fadd8ef 100644 --- a/HRM.UI/appsettings.json +++ b/HRM.UI/appsettings.json @@ -52,8 +52,8 @@ //"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", //"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development - "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBUATBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", - "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBUATBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development + "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", + "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development }, "Calendar": {