Skip to content

fix(button): use measurable backgrounds in all states - #2452

Merged
dancormier merged 3 commits into
mainfrom
STACKS-939/solid-button-backgrounds
Oct 16, 2026
Merged

dancormier merged 3 commits into
mainfrom
STACKS-939/solid-button-backgrounds

Conversation

@dancormier

@dancormier dancormier commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

https://stackoverflow.atlassian.net/browse/STACKS-939

Summary

Give buttons solid backgrounds so apca-check can measure base contrast in every state. Keep selected-state gradients on an inner ::before layer, with separate checks against both visible colors. The slight solid-color rim at transparent borders was reviewed and accepted locally. No changes to apca-check or SST assertions are needed.

Changes

  • Use solid ordinary/hover backgrounds and an isolated, non-interactive selected decoration; preserve checked-radio hover colors and disabled precedence.
  • Keep focused regression checks in the existing button accessibility tests: real APCA measurements, both selected colors against APCA/AAA thresholds, and radio hover across four themes.
  • Reuse the existing visual helper for four compact selected-state grids: 12 new baselines instead of 36. Retain the 16 reviewed WebKit ordinary-button baseline updates.
  • Include the Less snapshot and patch changeset for @stackoverflow/stacks. Selected buttons now use ::before; their approved CSS is unchanged by the test consolidation.

How to test

  1. Run npm ci, npm run build:dependencies -w packages/stacks-svelte, and npm run storybook -w packages/stacks-svelte. Open http://localhost:6006/?path=/docs/components-button--docs.
  2. Check ordinary/selected buttons and checked radio labels, including hover, in light, dark, and both high-contrast themes. The button should have no background image; the selected color split belongs to ::before. The slight rim has already passed local visual review. Default borders remain the intended design.
  3. Run npm run test:a11y -w packages/stacks-classic (2,593 passed, 155 skipped), npm run test:unit -w packages/stacks-classic (32 passed per browser), npm run test:less -w packages/stacks-classic (40 passed), npm run lint -w packages/stacks-classic, and npm run build -w packages/stacks-classic. All passed; the button accessibility file also passed all 808 cases in Chromium, Firefox, and WebKit.
  4. Run npm run test:visual -w packages/stacks-classic with Docker, PowerShell, and Git LFS available. Chromium and Firefox passed all 2,840 cases. WebKit passed 2,696 cases before a page crash in the unrelated bling fixture; all 144 bling cases passed on an isolated retry. Local visual verification used the repository's Docker image/config with --shm-size=1g and one test session per browser.

Focused accessibility-test type-checking passed. The broader Classic test-source typecheck still has existing errors. The unchanged runtime previously passed the Svelte suite (594 browser tests and 29 tooling tests). No dependencies or type configuration changed.

Axe's built-in WCAG rules still report selected pseudo-element backgrounds as incomplete; direct checks of both decorative colors provide the high-contrast AAA coverage.

Preview: Stacks docs · Svelte Storybook. Both deployments are ready for this PR head and respond with HTTP 200.

Success criteria

  • Non-selected buttons use solid backgrounds in normal and hover states.
  • Selected buttons and checked radio labels retain their gradients, including hover.
  • Regression tests assert actual contrast measurements—not merely absence of violations—for representative ordinary buttons.
  • Preserve appearance and behavior across light, dark, and both high-contrast themes, including clear, disabled, link, and unset variants. The slight selected-state rim was explicitly accepted after local comparison.
  • Run relevant accessibility, Less-output, visual, lint, and build checks; document blockers.
  • Include a patch changeset for @stackoverflow/stacks and document that selected-state contrast remains incomplete. The changeset is included; ticket wording still needs alignment: selected APCA checks complete, native WCAG checks remain incomplete, and separate tests verify both visible colors.

Screenshots

Screenshots coming soon. Compact selected-state grids are included in the visual baselines.

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for stacks-svelte ready!

Name Link
🔨 Latest commit a18832f
🔍 Latest deploy log https://app.netlify.com/projects/stacks-svelte/deploys/6ad13aa7f247de5c0baba866
😎 Deploy Preview https://deploy-preview-2452--stacks-svelte.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a18832f

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

This PR includes changesets to release 1 package
Name Type
@stackoverflow/stacks Patch

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

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for stackoverflow-email ready!

Name Link
🔨 Latest commit a18832f
🔍 Latest deploy log https://app.netlify.com/projects/stackoverflow-email/deploys/6ad13aa74c7c8076adedb0b2
😎 Deploy Preview https://deploy-preview-2452--stackoverflow-email.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for stacks ready!

Name Link
🔨 Latest commit a18832f
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/6ad13aa7ebcc08e8e45d2790
😎 Deploy Preview https://deploy-preview-2452--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@dancormier dancormier changed the title fix(button): use solid backgrounds outside selected states fix(button): use measurable backgrounds in all states Oct 15, 2026
@dancormier
dancormier marked this pull request as ready for review October 15, 2026 22:28
@dancormier
dancormier requested a review from a team as a code owner October 15, 2026 22:28
@dancormier
dancormier merged commit 8e61cd8 into main Oct 16, 2026
46 of 48 checks passed
@dancormier
dancormier deleted the STACKS-939/solid-button-backgrounds branch October 16, 2026 20:14
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