From f1b287fdb9d7b0708d6a1bbbdb34fc3189d330f4 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Sat, 25 Jul 2026 13:50:42 +0200 Subject: [PATCH] fix(client): address semantic theme review feedback --- client/src/components/Auth/LoginForm.tsx | 4 +-- client/src/components/Auth/Registration.tsx | 4 +-- .../components/Auth/RequestPasswordReset.tsx | 2 +- .../Auth/__tests__/LoginForm.spec.tsx | 2 +- .../Auth/__tests__/Registration.spec.tsx | 8 ++--- client/src/style.css | 30 ++++++++++------ client/src/utils/getThemeFromEnv.js | 8 +++++ client/src/utils/getThemeFromEnv.spec.js | 36 +++++++++++++++++++ packages/client/src/components/Dropdown.css | 2 +- packages/client/src/components/Field.css | 2 +- packages/client/src/theme/README.md | 4 ++- packages/client/src/theme/themes/dark.ts | 7 ++++ packages/client/src/theme/themes/default.ts | 7 ++++ packages/client/src/theme/types/index.ts | 21 +++++++++++ .../client/src/theme/utils/applyTheme.spec.ts | 33 +++++++++++++++++ packages/client/src/theme/utils/applyTheme.ts | 5 +++ .../src/theme/utils/createTailwindColors.js | 17 +++++---- .../theme/utils/createTailwindColors.spec.js | 20 +++++++++++ 18 files changed, 181 insertions(+), 31 deletions(-) create mode 100644 client/src/utils/getThemeFromEnv.spec.js create mode 100644 packages/client/src/theme/utils/applyTheme.spec.ts create mode 100644 packages/client/src/theme/utils/createTailwindColors.spec.js diff --git a/client/src/components/Auth/LoginForm.tsx b/client/src/components/Auth/LoginForm.tsx index ace05eff20..0c42724181 100644 --- a/client/src/components/Auth/LoginForm.tsx +++ b/client/src/components/Auth/LoginForm.tsx @@ -32,8 +32,8 @@ const LoginForm: React.FC = ({ onSubmit, startupConfig, error, const validTheme = isDark(theme) ? 'dark' : 'light'; const requireCaptcha = Boolean(startupConfig.turnstile?.siteKey); const authInputClassName = - 'webkit-dark-styles transition-color peer w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus:outline-none focus-visible:border-accent-primary'; - const authSecretInputClassName = `${authInputClassName} h-auto pr-12`; + 'webkit-dark-styles transition-color peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus:outline-none focus-visible:border-accent-primary'; + const authSecretInputClassName = `${authInputClassName} pr-12`; const authLabelClassName = 'absolute start-3 top-1.5 z-10 origin-[0] -translate-y-4 scale-75 transform bg-surface-primary px-2 text-sm text-text-secondary-alt duration-200 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-1.5 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-accent-primary rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4'; const authSecretButtonClassName = diff --git a/client/src/components/Auth/Registration.tsx b/client/src/components/Auth/Registration.tsx index ca0a6bcc6a..77da29c8f4 100644 --- a/client/src/components/Auth/Registration.tsx +++ b/client/src/components/Auth/Registration.tsx @@ -37,8 +37,8 @@ const Registration: React.FC = () => { // only require captcha if we have a siteKey const requireCaptcha = Boolean(startupConfig?.turnstile?.siteKey); const authInputClassName = - 'webkit-dark-styles transition-color peer w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus:outline-none focus-visible:border-accent-primary'; - const authSecretInputClassName = `${authInputClassName} h-auto pr-12`; + 'webkit-dark-styles transition-color peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus:outline-none focus-visible:border-accent-primary'; + const authSecretInputClassName = `${authInputClassName} pr-12`; const authLabelClassName = 'absolute start-3 top-1.5 z-10 origin-[0] -translate-y-4 scale-75 transform bg-surface-primary px-2 text-sm text-text-secondary-alt duration-200 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-1.5 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-accent-primary rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4'; const authSecretButtonClassName = diff --git a/client/src/components/Auth/RequestPasswordReset.tsx b/client/src/components/Auth/RequestPasswordReset.tsx index 6bf5c6fe4e..e07334703a 100644 --- a/client/src/components/Auth/RequestPasswordReset.tsx +++ b/client/src/components/Auth/RequestPasswordReset.tsx @@ -105,7 +105,7 @@ function RequestPasswordReset() { }, })} aria-invalid={!!errors.email} - className="webkit-dark-styles transition-color peer w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 focus:border-accent-primary focus:outline-none" + className="webkit-dark-styles transition-color peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 focus:border-accent-primary focus:outline-none" placeholder=" " />