This commit is contained in:
Mohaimen Hasan 2026-11-25 10:30:54 +06:00
parent f0dd787c47
commit 3c3959c38b
2 changed files with 17 additions and 2 deletions

View File

@ -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:

View File

@ -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": {