Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: mobile input font-size (#43244)

Francesco Sansalvadoref380c40b532d
diff --git a/apps/studio/components/ui/AIAssistantPanel/AssistantChatForm.tsx b/apps/studio/components/ui/AIAssistantPanel/AssistantChatForm.tsx
index 9e5d672b87e..bb22b8207c3 100644
--- a/apps/studio/components/ui/AIAssistantPanel/AssistantChatForm.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/AssistantChatForm.tsx
@@ -122,7 +122,7 @@ const AssistantChatFormComponent = forwardRef<HTMLFormElement, FormProps>(
ref={textAreaRef}
disabled={disabled}
className={cn(
- 'text-sm pr-10 pb-9 max-h-64',
+ 'text-base md:text-sm pr-10 pb-9 max-h-64',
sqlSnippets && sqlSnippets.length > 0 && 'pt-10'
)}
placeholder={placeholder}
diff --git a/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx b/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx
index 27efbd2b8b2..1385a871681 100644
--- a/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx
+++ b/packages/ui-patterns/src/AssistantChat/AssistantChatForm.tsx
@@ -79,7 +79,7 @@ const AssistantChatFormComponent = React.forwardRef<HTMLFormElement, FormProps>(
ref={textAreaRef}
autoFocus={isMobile}
disabled={disabled}
- className="text-sm pr-10 rounded max-h-64"
+ className="text-base md:text-sm pr-10 rounded max-h-64"
placeholder={placeholder}
spellCheck={false}
rows={3}
diff --git a/packages/ui-patterns/src/form/Layout/FormLayout.tsx b/packages/ui-patterns/src/form/Layout/FormLayout.tsx
index 4c556d3f442..d59acac9c3a 100644
--- a/packages/ui-patterns/src/form/Layout/FormLayout.tsx
+++ b/packages/ui-patterns/src/form/Layout/FormLayout.tsx
@@ -31,8 +31,8 @@ const ContainerVariants = cva('relative grid gap-10', {
variants: {
size: {
tiny: 'text-xs',
- small: 'text-sm leading-4',
- medium: 'text-sm',
+ small: 'text-base md:text-sm leading-4',
+ medium: 'text-base md:text-sm',
large: 'text-base',
xlarge: 'text-base',
},
diff --git a/packages/ui/src/components/Select/Select.test.jsx b/packages/ui/src/components/Select/Select.test.jsx
index 4e425003738..6a0113ba306 100644
--- a/packages/ui/src/components/Select/Select.test.jsx
+++ b/packages/ui/src/components/Select/Select.test.jsx
@@ -23,7 +23,7 @@ describe('#Select', () => {
</Select>
)
expect(screen.queryByTestId('form-select')).toHaveClass(
- 'block box-border w-full rounded-md shadow-sm transition-all text-foreground border focus-visible:shadow-md outline-none focus:ring-current focus:ring-2 focus-visible:border-foreground-muted focus-visible:ring-background-control placeholder-foreground-muted appearance-none bg-none bg-destructive-200 border border-destructive-500 focus:ring-destructive-400 placeholder:text-destructive-400 text-sm px-4 py-2'
+ 'block box-border w-full rounded-md shadow-sm transition-all text-foreground border focus-visible:shadow-md outline-none focus:ring-current focus:ring-2 focus-visible:border-foreground-muted focus-visible:ring-background-control placeholder-foreground-muted appearance-none bg-none bg-destructive-200 border border-destructive-500 focus:ring-destructive-400 placeholder:text-destructive-400 text-base md:text-sm px-4 py-2'
)
})
})
diff --git a/packages/ui/src/components/shadcn/ui/textarea.tsx b/packages/ui/src/components/shadcn/ui/textarea.tsx
index efc65c4111c..8d235682932 100644
--- a/packages/ui/src/components/shadcn/ui/textarea.tsx
+++ b/packages/ui/src/components/shadcn/ui/textarea.tsx
@@ -9,7 +9,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
return (
<textarea
className={cn(
- 'flex min-h-[80px] w-full rounded-md border border-control bg-foreground/[.026] px-3 py-2 text-sm ring-offset-background placeholder:text-foreground-muted focus:ring-background-control focus:border-control focus-visible:border-control focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-foreground-muted focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
+ 'flex min-h-[80px] w-full rounded-md border border-control bg-foreground/[.026] px-3 py-2 text-base md:text-sm ring-offset-background placeholder:text-foreground-muted focus:ring-background-control focus:border-control focus-visible:border-control focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-foreground-muted focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className
)}
ref={ref}
diff --git a/packages/ui/src/lib/constants.ts b/packages/ui/src/lib/constants.ts
index 18357f71568..8bfe0329373 100644
--- a/packages/ui/src/lib/constants.ts
+++ b/packages/ui/src/lib/constants.ts
@@ -45,8 +45,8 @@ export type AvailableColors =
export const SIZE = {
text: {
tiny: 'text-xs',
- small: 'text-sm leading-4',
- medium: 'text-sm',
+ small: 'text-base md:text-sm leading-4',
+ medium: 'text-base md:text-sm',
large: 'text-base',
xlarge: 'text-base',
},
diff --git a/packages/ui/src/lib/theme/defaultTheme.ts b/packages/ui/src/lib/theme/defaultTheme.ts
index 8635e5d5488..f55ce2919bd 100644
--- a/packages/ui/src/lib/theme/defaultTheme.ts
+++ b/packages/ui/src/lib/theme/defaultTheme.ts
@@ -35,10 +35,11 @@ const defaults = {
`,
size: {
// buttons, inputs, input labels use these sizes
+ // text-base on mobile (below md) to avoid zoom on focus
text: {
tiny: 'text-xs',
- small: 'text-sm leading-4',
- medium: 'text-sm',
+ small: 'text-base md:text-sm leading-4',
+ medium: 'text-base md:text-sm',
large: 'text-base',
xlarge: 'text-base',
},
@@ -1063,8 +1064,8 @@ export default {
},
size: {
tiny: 'text-xs',
- small: 'text-sm leading-4',
- medium: 'text-sm',
+ small: 'text-base md:text-sm leading-4',
+ medium: 'text-base md:text-sm',
large: 'text-base',
xlarge: 'text-base',
},