Skip to content

@remotion/design: Remove box-content from Switch inner element#6941

Merged
JonnyBurger merged 1 commit intomainfrom
fix/switch-remove-box-content
Mar 31, 2026
Merged

@remotion/design: Remove box-content from Switch inner element#6941
JonnyBurger merged 1 commit intomainfrom
fix/switch-remove-box-content

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

Summary

  • The Switch inner slider circle used box-content which made its total rendered size 24x24 (20px content + 4px borders), filling the entire track height with no visible gap
  • Remove box-content so it uses the default border-box from Tailwind's base reset, making the circle 20x20 total with symmetric 4px gaps on all sides
  • The existing position values (left-[4px] inactive, left-[calc(100%-24px)] active) produce correct symmetric spacing with border-box

Test plan

  • Verify Switch toggle circle has visible gap around it in the track
  • Verify Switch slides correctly between inactive and active positions
  • Verify on remotion.dev pricing page

🤖 Generated with Claude Code

The inner slider circle used box-content which made its total rendered
size 24x24 (20px content + 4px borders), filling the entire track with
no visible gap. Removing it uses the default border-box from Tailwind's
base reset, making the circle 20x20 total with symmetric 4px gaps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Mar 31, 2026

Reviewed PR #6941 — verified the box-sizing math is correct and the change produces symmetric 4px gaps around the toggle circle. No issues found, approved.

Task list (4/4 completed)
  • Read the full Switch component source
  • Verify box-sizing reasoning and impact
  • Check for other usages of the Switch component
  • Submit review or report progress

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Mar 31, 2026 11:55am
remotion Ready Ready Preview, Comment Mar 31, 2026 11:55am

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the math — with border-box, the 20x20 circle (including 2px borders) leaves symmetric 4px gaps on all sides within the track. The existing left/top position values and the active-state calc(100%-24px) are all correct for the new sizing. Clean fix.

Pullfrog  | View workflow run | Using Big Pickle (free) | 𝕏

@JonnyBurger JonnyBurger merged commit 7d982f5 into main Mar 31, 2026
16 of 17 checks passed
@JonnyBurger JonnyBurger deleted the fix/switch-remove-box-content branch March 31, 2026 12:02
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