diff --git a/src/app/globals.css b/src/app/globals.css index 91d72e44d..208d1ebd6 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -32,6 +32,20 @@ @custom-variant dark (&:is(.dark *)); +/* + * `pointer-fine:` — a mouse or trackpad is the primary pointer. Form fields + * take the compact 14 px type only under it: iOS and iPadOS Safari zoom the + * page into any focused field whose text is smaller than 16 px, and a width + * breakpoint alone (`md:text-sm`) handed 14 px to a phone held sideways + * (844 px) and to every iPad. Touch-first screens keep the 16 px base at + * every width. + */ +@custom-variant pointer-fine { + @media (hover: hover) and (pointer: fine) { + @slot; + } +} + @theme inline { /* Extra-small breakpoint (30rem / 480px) for the narrowest phones — the default scale starts at sm (640px), which leaves a gap between an iPhone SE diff --git a/src/components/insights/coach-panel/coach-input.tsx b/src/components/insights/coach-panel/coach-input.tsx index a6813f540..d651dd7d0 100644 --- a/src/components/insights/coach-panel/coach-input.tsx +++ b/src/components/insights/coach-panel/coach-input.tsx @@ -380,7 +380,7 @@ export function CoachInput({ autoCapitalize="sentences" rows={1} className={cn( - "order-1 w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed outline-none sm:text-sm", + "order-1 w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed outline-none sm:pointer-fine:text-sm", "px-2 py-1.5", "max-h-[9.5rem] overflow-auto", "[scrollbar-width:thin] [scrollbar-color:color-mix(in_srgb,var(--primary)_35%,transparent)_transparent]", diff --git a/src/components/ui/__tests__/textarea.test.tsx b/src/components/ui/__tests__/textarea.test.tsx index 6535a0b02..f8e6c4fc6 100644 --- a/src/components/ui/__tests__/textarea.test.tsx +++ b/src/components/ui/__tests__/textarea.test.tsx @@ -4,10 +4,12 @@ import { renderToStaticMarkup } from "react-dom/server"; import { Textarea } from "../textarea"; describe("