Skip to content

Increase default button and input sizing - #3710

Open
jodeleeuw wants to merge 1 commit into
mainfrom
feature/touch-target-defaults
Open

Increase default button and input sizing#3710
jodeleeuw wants to merge 1 commit into
mainfrom
feature/touch-target-defaults

Conversation

@jodeleeuw

Copy link
Copy Markdown
Member

Summary

.jspsych-btn computed to roughly 38px tall — 14px text at a 1.4 line-height, 8px of vertical padding, and a 1px border. That is below the 44px minimum target size given by WCAG 2.5.5 and the Apple Human Interface Guidelines, which makes experiments awkward to use on phones and tablets without custom CSS.

This raises the font to 16px and the padding to 12px/16px, bringing the button to roughly 48px on every device. Doing it in the base rule rather than under @media (pointer: coarse) means there is no separate touch rule to maintain, and mouse users get a more comfortable target too.

Text inputs move from 14px to 16px for the same reason, and because iOS Safari zooms the viewport when a field below 16px receives focus, leaving the participant on a partial view of the trial.

Breaking change

This alters the rendered appearance of every existing experiment that uses jspsych.css, so it is marked major and targeted at 9.0.

The reason to treat it as breaking rather than cosmetic is specific to this project: button size can influence how quickly participants respond. A lab that upgrades partway through data collection would get a silent change in the motor demands of its task between participants. docs/support/migration-v9.md says so explicitly and shows how to restore the previous sizing.

Changes

  • packages/jspsych/src/index.scss — the two rules, each with a comment explaining the figure
  • docs/support/migration-v9.md — new; this is the first breaking change queued for 9.0, and v7 and v8 both have migration guides
  • mkdocs.yml — nav entry for the new guide
  • docs/overview/style.md — documents the defaults and how to override them
  • .changeset/touch-target-defaults.mdmajor

Notes for review

  • The migration guide is new scaffolding. If you would rather it be written when 9.0 is actually being assembled, it can come out and the changeset alone can carry the note.
  • I did not build the mkdocs site, so the nav entry is unverified beyond matching its neighbours.

🤖 Generated with Claude Code

.jspsych-btn computed to roughly 38px tall, below the 44px minimum
target size given by WCAG 2.5.5 and the Apple Human Interface
Guidelines. Raising the font to 16px and the padding to 12px/16px
brings it to roughly 48px on every device, so no separate rule for
touch pointers is needed.

Text inputs move from 14px to 16px for the same reason, and because
iOS Safari zooms the viewport when a field below 16px receives focus.

BREAKING CHANGE: this alters the rendered appearance of every existing
experiment using jspsych.css. Button size can affect motor response
times, so studies partway through data collection should not upgrade.
Adds docs/support/migration-v9.md with instructions for restoring the
previous sizing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jodeleeuw jodeleeuw added this to the 9.0 milestone Jul 28, 2026
@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 97c7723

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
jspsych Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📦 Preview build ready

Built from PR head 97c7723 and published at 6641b02 on branch preview/pr-3710.
URLs below are pinned to an immutable commit SHA, so they are safe to share and are cached permanently by jsDelivr.

Changed packages: jspsych

Quick-start HTML:

<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/jspsych/dist/index.browser.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/jspsych/css/jspsych.css">
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-html-keyboard-response/dist/index.browser.min.js"></script>
All package URLs
  • @jspsych/extension-mouse-trackinghttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/extension-mouse-tracking/dist/index.browser.min.js
  • @jspsych/extension-record-videohttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/extension-record-video/dist/index.browser.min.js
  • @jspsych/extension-webgazerhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/extension-webgazer/dist/index.browser.min.js
  • jspsychhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/jspsych/dist/index.browser.min.js
  • @jspsych/plugin-animationhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-animation/dist/index.browser.min.js
  • @jspsych/plugin-audio-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-audio-button-response/dist/index.browser.min.js
  • @jspsych/plugin-audio-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-audio-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-audio-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-audio-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-browser-checkhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-browser-check/dist/index.browser.min.js
  • @jspsych/plugin-call-functionhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-call-function/dist/index.browser.min.js
  • @jspsych/plugin-canvas-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-canvas-button-response/dist/index.browser.min.js
  • @jspsych/plugin-canvas-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-canvas-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-canvas-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-canvas-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-categorize-animationhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-categorize-animation/dist/index.browser.min.js
  • @jspsych/plugin-categorize-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-categorize-html/dist/index.browser.min.js
  • @jspsych/plugin-categorize-imagehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-categorize-image/dist/index.browser.min.js
  • @jspsych/plugin-clozehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-cloze/dist/index.browser.min.js
  • @jspsych/plugin-external-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-external-html/dist/index.browser.min.js
  • @jspsych/plugin-free-sorthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-free-sort/dist/index.browser.min.js
  • @jspsych/plugin-fullscreenhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-fullscreen/dist/index.browser.min.js
  • @jspsych/plugin-html-audio-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-html-audio-response/dist/index.browser.min.js
  • @jspsych/plugin-html-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-html-button-response/dist/index.browser.min.js
  • @jspsych/plugin-html-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-html-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-html-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-html-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-html-video-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-html-video-response/dist/index.browser.min.js
  • @jspsych/plugin-iat-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-iat-html/dist/index.browser.min.js
  • @jspsych/plugin-iat-imagehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-iat-image/dist/index.browser.min.js
  • @jspsych/plugin-image-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-image-button-response/dist/index.browser.min.js
  • @jspsych/plugin-image-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-image-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-image-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-image-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-initialize-camerahttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-initialize-camera/dist/index.browser.min.js
  • @jspsych/plugin-initialize-microphonehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-initialize-microphone/dist/index.browser.min.js
  • @jspsych/plugin-instructionshttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-instructions/dist/index.browser.min.js
  • @jspsych/plugin-maxdiffhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-maxdiff/dist/index.browser.min.js
  • @jspsych/plugin-mirror-camerahttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-mirror-camera/dist/index.browser.min.js
  • @jspsych/plugin-preloadhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-preload/dist/index.browser.min.js
  • @jspsych/plugin-reconstructionhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-reconstruction/dist/index.browser.min.js
  • @jspsych/plugin-resizehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-resize/dist/index.browser.min.js
  • @jspsych/plugin-same-different-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-same-different-html/dist/index.browser.min.js
  • @jspsych/plugin-same-different-imagehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-same-different-image/dist/index.browser.min.js
  • @jspsych/plugin-serial-reaction-time-mousehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-serial-reaction-time-mouse/dist/index.browser.min.js
  • @jspsych/plugin-serial-reaction-timehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-serial-reaction-time/dist/index.browser.min.js
  • @jspsych/plugin-sketchpadhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-sketchpad/dist/index.browser.min.js
  • @jspsych/plugin-survey-html-formhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-survey-html-form/dist/index.browser.min.js
  • @jspsych/plugin-survey-likerthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-survey-likert/dist/index.browser.min.js
  • @jspsych/plugin-survey-multi-choicehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-survey-multi-choice/dist/index.browser.min.js
  • @jspsych/plugin-survey-multi-selecthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-survey-multi-select/dist/index.browser.min.js
  • @jspsych/plugin-survey-texthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-survey-text/dist/index.browser.min.js
  • @jspsych/plugin-surveyhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-survey/dist/index.browser.min.js
  • @jspsych/plugin-video-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-video-button-response/dist/index.browser.min.js
  • @jspsych/plugin-video-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-video-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-video-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-video-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-virtual-chinresthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-virtual-chinrest/dist/index.browser.min.js
  • @jspsych/plugin-visual-search-circlehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-visual-search-circle/dist/index.browser.min.js
  • @jspsych/plugin-webgazer-calibratehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-webgazer-calibrate/dist/index.browser.min.js
  • @jspsych/plugin-webgazer-init-camerahttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-webgazer-init-camera/dist/index.browser.min.js
  • @jspsych/plugin-webgazer-validatehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@6641b02beabffb17b1aa8f53511100517a544673/packages/plugin-webgazer-validate/dist/index.browser.min.js

Last updated 2026-07-28 23:13 UTC for PR head 97c7723.

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.

1 participant