Half the buttons in Tailwind v4 apps silently show an arrow cursor and snap on press. This skill clicks real buttons in Chromium to catch missing pointers, broken scale transitions, stuck mouse focus rings, and width jumps — without changing your button design.

POST /save0 reqs

cursor: default · stuck :focus ring · double-fires

Beforewidth jumps +62px · 0 reqs
POST /save0 reqs · guarded

cursor: pointer · CSS grid width lock · ref guard

After0px shift · 0 req guarded

Install

Copy the skill URL or pick your coding agent below. One file, no npm packages, MIT licensed.

https://hairlineui.com/skills/fix-buttons.md

Claude Code

Works in: Claude Code CLI, VS Code & JetBrains extensions, and Claude Desktop Code tab

Run this once inside your project (or use ~/.claude/skills for every project).

terminal
mkdir -p .claude/skills/fix-buttons && curl -sL https://hairlineui.com/skills/fix-buttons.md -o .claude/skills/fix-buttons/SKILL.md

Restart or type /fix-buttons in Claude Code. It scans the repo, runs the Chromium verifier, and reports every fix.

  • Zero redesign risk. Leaves your layout, brand colours, typography and component library alone.

  • Verified, not guessed. Every skill pairs static checks with a standalone verifier that proves the before and after counts.

  • No lock-in, MIT. Plain markdown plus a standalone script. Works on React, Next.js, Vue, Svelte, Astro or plain HTML.

What it catches

Every rule targets an objective browser defect and pairs a detection check with a root-cause fix.

  1. Tailwind v4 dropped cursor: pointer

    Tailwind v4 reset <button> to cursor: default, leaving primary and toolbar actions showing a plain arrow on hover.

    Restores cursor-pointer on enabled buttons and disabled:cursor-default / aria-disabled:cursor-default on inactive states.

  2. Tailwind v4 active:scale-* silently snapping

    In Tailwind v4, scale-* writes the standalone CSS scale property rather than transform — so transition-transform skips it completely.

    Explicitly lists scale in transition-[background-color,color,opacity,scale] with motion-reduce guards.

  3. Async buttons jumping width & shoving neighbors

    Swapping "Save" -> "Saving..." -> "Saved" resizes the button instantaneously and nudges adjacent Cancel buttons sideways.

    Stacks state labels in an overlapping CSS grid cell (col-start-1 row-start-1) so every state locks to the widest label with zero JS.

  4. Double-submit race conditions

    Clicking Save, Pay, or Create twice before React commits pending state fires duplicate mutations.

    Adds a synchronous ref guard alongside aria-busy so duplicate clicks are ignored from millisecond zero.

  5. Stuck blue focus rings after mouse clicks

    Using focus:ring instead of focus-visible:ring leaves a heavy outline stuck around buttons after ordinary pointer clicks.

    Migrates focus rings to focus-visible:ring so mouse clicks stay clean while keyboard Tab stays sharp.

  6. Unlabeled icon buttons & trapped tooltips

    SVG-only buttons without aria-label are silent to screen readers, and native disabled blocks hover/focus tooltips explaining why.

    Adds clear aria-labels on icon buttons and converts tooltipped disabled controls to aria-disabled="true" with guarded handlers.

Chromium verifier

Audits every visible button in Chromium for cursor: pointer, parses loaded CSS for Tailwind v4 active:scale-* paired with transition-transform (missing scale), clicks buttons with a real mouse pointer to detect stuck focus: rings and async offsetWidth jumps, flags unlabeled icon buttons, and catches disabled buttons trapping tooltips.

curl -sL https://hairlineui.com/skills/fix-buttons-check.mjs -o /tmp/fix-buttons-check.mjsnode /tmp/fix-buttons-check.mjs http://localhost:3000 --routes /,/settings,/billing

Then just run it

Run it on a single page while building, or across your main routes before shipping.

  • “Run /fix-buttons across our settings and toolbar screens — fix Tailwind v4 cursor and scale transitions and lock async button widths.”

  • “Audit all buttons with /fix-buttons and switch focus: rings to focus-visible: without changing our colors.”

  • “Find every icon button missing an aria-label and every disabled button blocking tooltips using /fix-buttons.”

Source

Read every line before installing. Both files are plain text under the MIT licence.

---name: fix-buttonsdescription: Find and fix every dead, jumpy, double-submitting button in your app — including the two silent bugs Tailwind v4 introduced (dropped cursor:pointer on buttons and active:scale-* snapping under transition-transform), async width jumps (Save -> Saving -> Saved), stuck mouse focus rings (focus: vs focus-visible:), icon-only buttons missing aria-label, and disabled buttons trapping tooltips. Works on any React, Next.js, Vue, Svelte, Astro, or Tailwind app.license: MITmetadata:  author: Hairline UI  url: https://hairlineui.com/skills/fix-buttons  version: "1.0.0"---# /fix-buttonsFind and fix every button defect that makes a web app feel sluggish or half-finished: Tailwind v4's silent missing `cursor: pointer`, Tailwind v4's broken `active:scale-*` press transition, async `"Save" -> "Saving..." -> "Saved"` width jumps that shove neighboring buttons sideways, double-submit clicks, stuck blue focus rings on mouse click, icon buttons missing accessible names, and `disabled` buttons that kill explanatory tooltips.This skill is **zero-redesign and zero-lock-in**. It keeps your exact brand colors, border radii, shadows, and button design intact while fixing every mechanical interaction defect.## Guardrails (never break these)- **Do not restyle the project's button aesthetic.** Keep existing colors, shapes, heights, and design-system variants intact.- **Do not break form submission semantics.** Preserve `type="submit"` inside `<form>` and explicitly set `type="button"` on non-submit buttons inside forms so they never submit accidentally.- **Never remove keyboard focus rings.** Replace `focus:` rings with `focus-visible:` so mouse clicks stay clean while keyboard `Tab` stays unmistakably visible.- **Never add external animation or UI libraries.** Every fix is pure CSS, HTML, Tailwind, and React state.- **Verify every fix in Chromium before reporting.**---## Step 1 — Measure the baseline (browser + source scan)### 1A. Run the Chromium button verifier (recommended)With your local dev server running, fetch and run the verifier across your main routes:```bashcurl -sL https://hairlineui.com/skills/fix-buttons-check.mjs -o /tmp/fix-buttons-check.mjsnode /tmp/fix-buttons-check.mjs http://localhost:3000 --routes /,/settings,/billing```*(On Windows PowerShell: `curl.exe -sL https://hairlineui.com/skills/fix-buttons-check.mjs -o $env:TEMP\fix-buttons-check.mjs` then `node $env:TEMP\fix-buttons-check.mjs http://localhost:3000`.)*Save the baseline counts: buttons missing `cursor: pointer`, broken `scale` press transitions, mouse-click stuck focus rings, width-jumping controls, icon buttons without `aria-label`, and `disabled` buttons carrying tooltips.### 1B. Static source scan```bashG='-g *.{tsx,jsx,ts,js,vue,svelte,astro,html} -g !node_modules -g !.next -g !dist'# 1. Tailwind v4 broken press transitions: active:scale-* paired with transition-transform (snaps!)rg -n 'active:scale-[^\s"\x27`]+.*transition-transform|transition-transform.*active:scale-' $G .# 2. Mouse-click stuck focus rings (focus:ring / focus:outline instead of focus-visible:)rg -n '\bfocus:(ring|outline)-[a-z0-9]' $G .# 3. Async label swaps that jump button width without locking sizerg -n '\?\s*["\x27](Saving|Saved|Loading|Submitting|Deleting|Sending|Sent|Copied|Updating|Creating)' $G .# 4. Disabled buttons with title/tooltip attributes (tooltips never fire on disabled buttons)rg -n '<button[^>]*\bdisabled\b[^>]*\btitle=|<button[^>]*\btitle=[^>]*\bdisabled\b' $G .# 5. Buttons inside <form> missing an explicit type attributerg -n '<button(?![^>]*\btype=)' --pcre2 $G .```---## Step 2 — Fix each class of button bug### 2.1 Tailwind v4 dropped `cursor: pointer` on `<button>`Tailwind v4 intentionally changed `<button>` preflight from `cursor: pointer` to `cursor: default`. Half the buttons in migrated or newly scaffolded Tailwind v4 apps silently show the default arrow cursor on desktop.- **Fix (choose what fits the project):**  - **Shared button primitive / components:** Add `cursor-pointer disabled:cursor-default aria-disabled:cursor-default` directly on interactive button components and `<button>` elements (keeps reusable components portable).  - **App-wide safety net (if the project prefers global pointer on enabled buttons):**    ```css    @layer base {      button:not(:disabled):not([aria-disabled="true"]),      [role="button"]:not([aria-disabled="true"]) {        cursor: pointer;      }    }    ```### 2.2 Tailwind v4's silent `active:scale-*` snap bugIn Tailwind v4, `scale-*` writes the standalone CSS **`scale`** property (`scale: 0.97`), **not** `transform: scale(0.97)`. That means `transition-transform active:scale-[0.97]` silently snaps with zero easing!- **Fix:** Explicitly include `scale` in the transition list (and respect reduced motion):  ```html  transition-[background-color,color,border-color,opacity,scale] duration-150 ease-[cubic-bezier(0.16,1,0.3,1)] active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100  ```- Also add subtle press feedback (`active:scale-[0.97]`) to primary and secondary action buttons that currently give zero visual acknowledgment when clicked.### 2.3 Async label width jumps & double-submit race conditionsSwapping `"Save"` -> `"Saving..."` -> `"Saved"` or `"Copy"` -> `"Copied!"` resizes the button instantaneously and pushes sibling buttons ("Cancel", toolbar icons) sideways. Worse, async `onClick` handlers without an in-flight guard let fast double-clicks fire duplicate API requests.- **Fix 1 — Lock button width across states using an overlapping CSS grid cell (zero JS measurement needed!):**  ```tsx  <button    type="button"    disabled={status === 'saving'}    aria-busy={status === 'saving'}    onClick={handleSave}    className="inline-grid cursor-pointer place-items-center ... disabled:cursor-default"  >    {/* Every possible label reserves width in the same grid cell; only the active one is visible */}    <span className="col-start-1 row-start-1 invisible" aria-hidden="true">Saving…</span>    <span className="col-start-1 row-start-1 invisible" aria-hidden="true">Save changes</span>    <span className="col-start-1 row-start-1">      {status === 'saving' ? 'Saving…' : status === 'saved' ? 'Saved' : 'Save changes'}    </span>  </button>  ```  *(All states share the widest label's exact width, so sibling controls never budge by 1px.)*- **Fix 2 — Guard against double-submit with a ref lock (not React state alone, which lags by one render):**  ```tsx  const busyRef = useRef(false);  const handleSave = async () => {    if (busyRef.current) return;    busyRef.current = true;    setStatus('saving');    try {      await save();      setStatus('saved');    } catch {      setStatus('error');    } finally {      busyRef.current = false;    }  };  ```### 2.4 Mouse-click stuck focus rings (`focus:` -> `focus-visible:`)Using `focus:ring-2` or `focus:outline` leaves a heavy ring stuck around a button after a normal mouse click.- **Fix:** Replace `focus:ring-*` / `focus:outline-*` on buttons and links with `outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2`. Mouse clicks stay spotless; pressing `Tab` shows a crisp keyboard focus ring.### 2.5 Icon-only buttons & `disabled` buttons killing tooltips- **Icon-only buttons:** Every `<button>` containing only an `<svg>` or icon glyph must have a clear `aria-label` (e.g. `aria-label="Close modal"`, `aria-label="Copy invite link"`), and mark the decorative `<svg aria-hidden="true">`.- **`disabled` buttons with tooltips:** Native `disabled` removes the button from pointer events and keyboard focus, so users can never see the tooltip explaining *why* it is disabled (e.g. "Fill in billing email first"). Replace `disabled` with **`aria-disabled="true"`**, guard `onClick` (`if (isDisabled) return;`), and style with `aria-disabled:opacity-50 aria-disabled:cursor-not-allowed` so tooltips still work for mouse and keyboard users.---## Step 3 — Verify every fix in Chromium1. Run your project's typecheck and build.2. Re-run the verifier across the same routes:   ```bash   node /tmp/fix-buttons-check.mjs http://localhost:3000 --routes /,/settings,/billing   ```3. Confirm:   - `0` enabled buttons missing `cursor: pointer`.   - `0` broken Tailwind v4 `active:scale-*` + `transition-transform` rules.   - `0` buttons showing stuck focus rings on mouse click.   - `0` icon-only buttons missing an accessible name.   - `0` `disabled` buttons trapping a `title` or tooltip.---## Step 4 — Report (keep it tight)```text/fix-buttons — verified in Chromium  Missing cursor:pointer (TW v4):      18 → 0  Broken scale press transitions:       6 → 0  (added scale to transition-property)  Mouse-click stuck focus rings:        9 → 0  (focus: → focus-visible:)  Width-jumping async buttons:          4 → 0  (grid-stacked state width lock + ref guard)  Icon buttons missing aria-label:      5 → 0  Disabled buttons hiding tooltips:     2 → 0  (disabled → aria-disabled)Files changed:- src/components/ui/button.tsx — cursor-pointer, transition-[...,scale], focus-visible ring- src/components/SettingsForm.tsx — width-locked Save button + double-submit ref guard- src/components/Toolbar.tsx — added aria-labels on 4 icon buttons, aria-disabled on ExportNot checked:- Checkout button inside hosted payment iframe```
/skills/fix-buttons.md
The full skill in plain markdown with YAML frontmatter. Drop into .claude/skills, .cursor/rules or .agents/skills.
/skills/fix-buttons-check.mjs
Standalone Node verifier for /fix-buttons. Runs locally with --json and --fail flags.

Templates

Every Hairline template passes these out of the box

65 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.