From 0cfadbef681700f984c3cee87a72d98b7a0d5d3c Mon Sep 17 00:00:00 2001 From: Mohaimen Hasan Date: Sun, 22 Nov 2026 19:11:09 +0600 Subject: [PATCH] go hr theme --- .../src/styles/theme/gohr-theme.scss | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss b/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss index b153838..5e89542 100644 --- a/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss +++ b/HRM.UI/ClientApp/src/styles/theme/gohr-theme.scss @@ -980,3 +980,172 @@ $tree: '.k-treeview:not(.k-column-menu *, .k-pivotgrid-configurator-content *, . opacity: 1; background-color: color-mix(in srgb, var(--gh-sb) 40%, transparent); } + +// ===================================================================================== +// Master data entry form (form-builder / ): +// the Add/Edit dialog of every master-data screen (Employee Type, Category, Cost Center, ...). +// Appearance only. Every control, binding, validator, the "... is required" message, the Save +// button's [disabled] state, form width/height from the screen config and all @switch cases +// stay exactly as they are. Everything is scoped to app-basic-entry-form. +// - one look for every control type (textbox, number, date, dropdown, checkbox) +// - no left-edge marker: forms.css paints .ng-invalid/.ng-valid[required] with a 5px left +// border (it also hit the [formGroup] wrapper), and each wrapper had an inline border-left +// - two-column grid that falls back to one column in narrow dialogs, even spacing +// - an invalid field shows a red border only once the user has touched it +// ===================================================================================== +$mf: '#{$std} app-basic-entry-form'; + +// Dialog body +#{$mf} .k-dialog-content { + padding: 20px 24px 16px; + background-color: var(--gh-tb); +} +#{$mf} form { + container-type: inline-size; +} +#{$mf} fieldset { + border: 0 !important; + margin: 0 !important; + padding: 0 !important; + min-width: 0; +} + +// Grid of fields +#{$mf} .form-row-wrapper { + display: grid !important; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 18px 20px; +} +@container (max-width: 520px) { + #{$mf} .form-row-wrapper { + grid-template-columns: minmax(0, 1fr); + } +} +#{$mf} .form-row-wrapper > .form-row { + width: auto !important; + height: auto !important; + padding: 0 !important; + min-width: 0; +} + +// One field: label, control, message +#{$mf} app-basic-from-control > .row { + display: block !important; + width: 100% !important; + max-width: none !important; + margin: 0 !important; + padding: 0 !important; + flex: none !important; +} +#{$mf} app-basic-from-control > .row > div { + display: flex; + flex-direction: column; + gap: 6px; + border-left: 0 none !important; // inline border-left on every wrapper +} +#{$mf} app-basic-from-control br { + display: none; +} +#{$mf} app-basic-from-control label { + margin: 0; + font-size: calc(var(--gh-fz) * 13 / 14); + font-weight: 600; + line-height: 1.3; + color: var(--gh-ht); + letter-spacing: .01em; +} +#{$mf} app-basic-from-control .errorMessage { + margin-top: -1px; + font-size: calc(var(--gh-fz) * 12 / 14); + line-height: 1.3; + color: var(--gh-dn) !important; +} + +// No left-edge validity marker anywhere in this form (forms.css) +#{$mf} :is(.ng-invalid, .ng-valid):not(form) { + border-left-width: 0; +} + +// Every control type gets the same box +#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker):not(.k-input .k-input, .k-picker .k-input) { + width: 100% !important; + border: 1px solid var(--gh-bo2) !important; + border-radius: var(--gh-field-r) !important; + background: var(--gh-tb) !important; + color: var(--gh-ht) !important; + font-family: var(--gh-font) !important; + font-size: var(--gh-fz) !important; + box-shadow: none !important; + transition: border-color .15s, box-shadow .15s; +} +#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker):not(.k-input .k-input, .k-picker .k-input):hover { + border-color: color-mix(in srgb, var(--gh-btn) 55%, var(--gh-bo2)) !important; +} +#{$mf} app-basic-from-control :is(input.k-textbox:focus, .k-input:focus-within, .k-picker:focus-within, .k-focus):not(.k-input .k-input, .k-picker .k-input) { + border-color: var(--gh-focus) !important; + box-shadow: 0 0 0 3px var(--gh-ring) !important; + outline: none; +} +// Touched and still invalid: red border (untouched empty fields stay neutral) +#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker).ng-invalid.ng-touched { + border-color: var(--gh-dn) !important; +} +#{$mf} app-basic-from-control :is(input.k-textbox, .k-input, .k-picker).ng-invalid.ng-touched:is(:focus, :focus-within, .k-focus) { + box-shadow: 0 0 0 3px color-mix(in srgb, var(--gh-dn) 20%, var(--gh-tb)) !important; +} +// Inner parts of date picker / dropdown: no own border or background +#{$mf} app-basic-from-control :is(.k-input, .k-picker) :is(.k-input-inner, .k-input-value-text, .k-dateinput) { + border: 0 !important; + background: transparent !important; + color: inherit !important; + font-family: inherit !important; + font-size: inherit !important; + font-weight: 400 !important; +} +#{$mf} app-basic-from-control :is(.k-input, .k-picker) > .k-input-button { + border: 0 !important; + border-left: 1px solid var(--gh-bo) !important; + border-radius: 0 !important; + background: var(--gh-pb) !important; + color: var(--gh-muted) !important; +} +#{$mf} app-basic-from-control :is(.k-input, .k-picker) > .k-input-button:hover { + color: var(--gh-lk) !important; + background: var(--gh-sel) !important; +} +// Read-only and disabled +#{$mf} app-basic-from-control input.k-textbox[readonly], +#{$mf} app-basic-from-control :is(.k-input, .k-picker).k-disabled { + background: var(--gh-pb) !important; + color: var(--gh-muted) !important; +} +// Checkbox: its own size, not stretched to the field width +#{$mf} app-basic-from-control input[type=checkbox] { + width: 18px !important; + height: 18px; + margin: 4px 0 0; + border-left-width: revert; + accent-color: var(--gh-btn); + cursor: pointer; +} + +// Footer: divider, buttons on the right (Close, then Save) +#{$mf} form > fieldset:last-of-type { + margin-top: 20px !important; + padding-top: 14px !important; + border-top: 1px solid var(--gh-bo) !important; +} +#{$mf} form > fieldset:last-of-type > .text-right { + float: none !important; + display: flex; + justify-content: flex-end; + align-items: center; + gap: 8px; + font-size: 0; // drops the   after Save +} +#{$mf} form > fieldset:last-of-type > .text-right > .k-button { + margin: 0 !important; + width: auto !important; + min-width: 96px; + font-size: var(--gh-fz); +}