From cc00c3ec93d134c1772577cccb355fd69c9b0f43 Mon Sep 17 00:00:00 2001 From: Jimmy Ben Klieve Date: Fri, 21 Nov 2025 09:58:55 +0800 Subject: [PATCH] component horizontal padding adjustment (#11418) ### What problem does this PR solve? - Adjust component a suitable horizontal padding when have prefix or suffix icon - Slightly change visual effect of in admin UI ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/components/ui/input.tsx | 6 +++--- web/src/pages/admin/components/theme-switch.tsx | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/web/src/components/ui/input.tsx b/web/src/components/ui/input.tsx index 20fe40460..7eb1c0fe4 100644 --- a/web/src/components/ui/input.tsx +++ b/web/src/components/ui/input.tsx @@ -45,9 +45,9 @@ const Input = React.forwardRef( 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary', 'disabled:cursor-not-allowed disabled:opacity-50 transition-colors', { - 'pl-12': !!prefix, - 'pr-12': !!suffix || isPasswordInput, - 'pr-24': !!suffix && isPasswordInput, + 'pl-[calc(1em+1.25rem)]': !!prefix, + 'pr-[calc(1em+1.25rem)]': !!suffix || isPasswordInput, + 'pr-[calc(2em+2rem)]': !!suffix && isPasswordInput, }, type === 'number' && '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none', diff --git a/web/src/pages/admin/components/theme-switch.tsx b/web/src/pages/admin/components/theme-switch.tsx index bfcfb3212..1f4dde3e9 100644 --- a/web/src/pages/admin/components/theme-switch.tsx +++ b/web/src/pages/admin/components/theme-switch.tsx @@ -25,8 +25,8 @@ const ThemeSwitch = forwardRef< setTheme(value ? ThemeEnum.Dark : ThemeEnum.Light) } > -
-
+
+
@@ -39,7 +39,7 @@ const ThemeSwitch = forwardRef< -
+
);