diff --git a/src/components/window/TitleBar.module.css b/src/components/window/TitleBar.module.css index 0be491b..6e2bbf3 100644 --- a/src/components/window/TitleBar.module.css +++ b/src/components/window/TitleBar.module.css @@ -26,13 +26,6 @@ cursor: pointer !important; } -/* Enlarge button touch targets on coarse pointers (WCAG AA: ≥24px) */ -@media (pointer: coarse) { - .titleBar :global(.title-bar-controls) button { - min-width: 24px !important; - min-height: 24px !important; - } -} .titleBarLeft { display: flex; diff --git a/src/components/window/TitleBar.test.tsx b/src/components/window/TitleBar.test.tsx index a4ab33a..fcae03b 100644 --- a/src/components/window/TitleBar.test.tsx +++ b/src/components/window/TitleBar.test.tsx @@ -77,4 +77,19 @@ describe('TitleBar', () => { expect(img).toBeInTheDocument(); expect(img).toHaveAttribute('src', '/icon.png'); }); + + it('does not enlarge title bar buttons on touch devices (no pointer:coarse min-size override)', async () => { + const { default: titleBarStyles } = await import('./TitleBar.module.css?raw'); + const rawCss = + typeof titleBarStyles === 'string' + ? titleBarStyles + : await import('node:fs/promises').then(({ readFile }) => + readFile(join(process.cwd(), 'src/components/window/TitleBar.module.css'), 'utf8'), + ); + + // TitleBar must not contain any pointer:coarse media rule + // — it would enlarge buttons and make the title bar too thick on mobile. + const coarseRule = rawCss.match(/@media\s*\(\s*pointer\s*:\s*coarse\s*\)/); + expect(coarseRule).toBeNull(); + }); });