Skip to content

Switch: reset -webkit-appearance for iOS + size-agnostic pill radius (CS-12328)#5606

Closed
burieberry wants to merge 1 commit into
mainfrom
cs-12328-boxel-ui-switch-webkit-appearance
Closed

Switch: reset -webkit-appearance for iOS + size-agnostic pill radius (CS-12328)#5606
burieberry wants to merge 1 commit into
mainfrom
cs-12328-boxel-ui-switch-webkit-appearance

Conversation

@burieberry

Copy link
Copy Markdown
Contributor

What

Two cross-browser / robustness fixes to the boxel-ui Switch (packages/boxel-ui/addon/src/components/switch/index.gts):

  1. iOS Safari native control leak. The thumb <input type="checkbox"> was reset with unprefixed appearance: none only. iOS Safari keeps rendering the native checkbox unless -webkit-appearance: none is also set, so on iOS the thumb ignored background / box-shadow / border-radius and rendered as a squared native control. Added -webkit-appearance: none alongside appearance: none.

  2. Track radius tied to natural size. The track used a fixed border-radius: 1.25rem tuned to the default height, so consumers that size the Switch taller (e.g. the homepage mode toggle) got a non-pill track. Switched to border-radius: 999px — renders identically at the natural size and stays a full pill at any size.

Why

Surfaced by the homepage mode-toggle bug (CS-12311): the toggle looked squared only on real iOS Safari, never in desktop responsive view — the tell-tale sign of a native-control-appearance leak rather than a radius-math problem. Affects every Switch instance on iOS, not just the homepage toggle.

Follow-up

cardstack/boxel-home carries a temporary consumer-side override for this in boxel-ai-website/components/site-navbar.gts (PR #68). Once this lands and boxel-ui is bumped there, that override should be removed (tracked in CS-12328).

Testing

  • Verify the switch renders as a rounded pill with a circular thumb on real iOS Safari.
  • Verify no visual change at the natural size in Chrome/Firefox/desktop Safari.

Fixes CS-12328.

🤖 Generated with Claude Code

…S-12328)

iOS Safari kept rendering the native checkbox because the thumb was reset
with unprefixed `appearance: none` only; add `-webkit-appearance: none` so
the thumb honors our background/box-shadow/border-radius on iOS. Also swap
the track's fixed 1.25rem radius for 999px so it stays a full pill when a
consumer sizes the switch taller than its natural height.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 33m 24s ⏱️
3 654 tests 3 639 ✅ 15 💤 0 ❌
3 673 runs  3 658 ✅ 15 💤 0 ❌

Results for commit 59f2cd5.

Realm Server Test Results

    1 files      1 suites   13m 28s ⏱️
1 935 tests 1 935 ✅ 0 💤 0 ❌
2 014 runs  2 014 ✅ 0 💤 0 ❌

Results for commit 59f2cd5.

@burieberry

Copy link
Copy Markdown
Contributor Author

Closing for now. Investigation on CS-12311 showed the stock Switch actually renders fine on iOS, so the -webkit-appearance change here fixes a non-bug. The real improvements (thumb-travel geometry, focus-visible ring, box-sizing, event handling, plus a shared --boxel-border-radius-pill token) are broader than this draft; re-scoping on CS-12328 and will reopen/replace with a fuller PR.

@burieberry burieberry closed this Jul 24, 2026
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