Skip to content

fix(web): restore pointer cursor on buttons - #595

Open
xbsheng wants to merge 1 commit into
shareAI-lab:mainfrom
xbsheng:fix/web-button-cursor
Open

xbsheng wants to merge 1 commit into
shareAI-lab:mainfrom
xbsheng:fix/web-button-cursor

Conversation

@xbsheng

@xbsheng xbsheng commented Oct 12, 2026

Copy link
Copy Markdown

Fixes #594.

What was wrong

Every <button> in web/ stayed on the browser's default arrow cursor when hovered — the locale switcher and dark-mode toggle in the header are the most visible, but the same applied to the Compare/Diff tabs, the simulator and visualization playback controls, and the Design Decisions collapsibles.

Cause: web/ is on Tailwind CSS v4, whose preflight no longer contains the v3 rule button, [role="button"] { cursor: pointer }. Buttons therefore fall back to cursor: default, while <a> (nav links, GitHub icon) still gets pointer from the UA stylesheet — hence the mixed appearance in the same header row.

Confirmed against the production bundle: the only cursor declaration in the deployed CSS is .cursor-pointer, used exactly once (web/src/app/[locale]/page.tsx:219).

Fix

Restore the rule once in web/src/app/globals.css, rather than adding cursor-pointer to each of the 18 buttons:

button:not(:disabled),
[role="button"]:not(:disabled) {
  cursor: pointer;
}

:not(:disabled) is deliberate: step-controls.tsx and simulator-controls.tsx have disabled buttons, and those should keep the default cursor.

Verification

  • npm ci && npm run build in web/ succeeds, and the emitted CSS chunk contains button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}.
  • Diff is one file, CSS only; no component or generated-data changes.

AI disclosure

I used an AI coding agent to trace the cause and draft this patch. I read the full diff, ran the build, and stand behind the change.

Tailwind v4 dropped the v3 preflight rule that set `cursor: pointer` on
`button, [role="button"]`, so every <button> in the web app fell back to
the UA default. <a> elements (nav links, GitHub icon) were unaffected, which
is why only the locale switcher and dark-mode toggle looked broken in the header.

Restore the rule once in globals.css instead of adding `cursor-pointer` to
each of the 18 buttons. `:not(:disabled)` keeps disabled playback controls
on the default cursor.

Closes shareAI-lab#594

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Buttons show the default arrow cursor on hover (Tailwind v4 dropped the preflight cursor: pointer)

1 participant