Skip to content

fix(mosaic): remove the card edge padding from switcher popups - #11087

Merged
alexcarpenter merged 1 commit into
mainfrom
carp/mosaic-switcher-padding
Dec 2, 2026
Merged

alexcarpenter merged 1 commit into
mainfrom
carp/mosaic-switcher-padding

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Description

The Card spacing rebuild (#11047) added edge padding above the card's first part and above the branding. The switcher popups (UserButton, OrganizationSwitcher, Switcher) render their own header and rows inside Card.Root, so they picked up 12px of extra space above the header and above "Secured by Clerk". This removes it from the switcher popups only.

  • Card.Root now reads that edge padding from a private --_cl-card-edge var, which defaults to the same value, so other cards keep their spacing.
  • SwitcherPopup sets --_cl-card-edge: 0px on its card.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Verified in swingset from evidence 20261202T210018Z-switcher-padding, captured at 2a839b79efa8; before 20261202T210139Z-switcher-padding-control, captured at 2a839b79efa8 with uncommitted changes. Attached at pull request head 2a839b79efa8.

Before After
Before: switcher-dark After: switcher-dark
Before: switcher-light After: switcher-light

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Dec 2, 2026 9:04pm UTC
mosaic-docs Ready Ready Preview Dec 2, 2026 9:04pm UTC
swingset Ready Ready Preview Dec 2, 2026 9:04pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Dec 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a839b7

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

This PR includes changesets to release 3 packages
Name Type
@clerk/mosaic Patch
@clerk/mosaic-docs Patch
@clerk/swingset 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

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Card edge padding now uses the --_cl-card-edge custom property. Switcher popup styles set this property to 0px, and Card.Root receives those styles. A changeset records a patch release for @clerk/mosaic and describes the popup spacing change.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Suggested reviewers: maxyinger, austincalvelage

Merge Risk: Low · up to 2a839

The popup spacing fix is narrow and low risk. When branding is hidden, the bottom spacing may be tighter than before. Worth a quick visual check before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: removing card edge padding from the switcher popups in the mosaic package. The changeset removes the extra top spacing above the header and the Clerk branding in the U…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states that the Card spacing rebuild added 12px of edge padding above the card header and branding, and that switcher popups (UserButton, OrganizationSwitcher, Switcher) picked up that…
Full details: Title check

Explanation

The title names the main change: removing card edge padding from the switcher popups in the mosaic package. The changeset removes the extra top spacing above the header and the Clerk branding in the UserButton, OrganizationSwitcher, and Switcher popups, and the title's 'fix(mosaic)' prefix matches the patch changeset. The title is specific and concise.

Full details: Description check

Explanation

The description states that the Card spacing rebuild added 12px of edge padding above the card header and branding, and that switcher popups (UserButton, OrganizationSwitcher, Switcher) picked up that extra space. It says the fix removes the padding from those popups only by adding a private --_cl-card-edge variable, defaulting to the prior value, and setting it to 0px in SwitcherPopup. This matches the changeset summary and the style changes in card.styles.ts and switcher-popup.styles.ts. The description is specific and directly related to the changeset, so it passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: This review skipped 6 repositories. Cross-repository analysis may be incomplete. Check linked repository access and settings.

@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@11087

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@11087

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@11087

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@11087

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@11087

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@11087

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@11087

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@11087

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@11087

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@11087

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@11087

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@11087

@clerk/express

npm i https://pkg.pr.new/@clerk/express@11087

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@11087

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@11087

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@11087

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@11087

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@11087

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@11087

@clerk/react

npm i https://pkg.pr.new/@clerk/react@11087

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@11087

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@11087

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@11087

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@11087

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@11087

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@11087

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@11087

commit: 2a839b7

@blacksmith-sh

blacksmith-sh Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Matches Switcher popup loses extra top and branding padding

Header moved from 12px to 0px below the popup top, the padding above "Secured by Clerk" went from 12px to 0px, and the popup shrank from 426px to 402px.

Merge-baseThis PR 2a839b79
Switcher popupSwitcher popup

Also checked · 2 match

Matches UserButton and OrganizationSwitcher popups lose the padding too
Matches Card story cards keep their edge padding · Narrowed from "Cards outside the switcher popups, such as the plain Card story, keep the same edge padding as before."

Proof on 2a839b79 · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional comments: 1

packages/mosaic/src/components/card/card.styles.ts-40-40: 1

40-40: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Preserve the bottom padding when branding is disabled.

When renderBranding is false, Card.Root applies root.end. The switcher override makes this padding 0px, so the popup also loses its bottom edge spacing. The stated change targets the top gaps. Keep EDGE for the bottom padding.

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5c54e82 and 2a839b7.

Files selected for processing: 4

  • .changeset/mosaic-switcher-padding.md
  • packages/mosaic/src/components/card/card.styles.ts
  • packages/mosaic/src/components/switcher/switcher-popup.styles.ts
  • packages/mosaic/src/components/switcher/switcher-popup.tsx
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.

@alexcarpenter
alexcarpenter merged commit 4915e6f into main Dec 2, 2026
103 of 104 checks passed
@alexcarpenter
alexcarpenter deleted the carp/mosaic-switcher-padding branch December 2, 2026 21:22

This branch was successfully deployed

2 active deployments
Preview – swingset — 2a839b79 Deployed Dec 2, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 2a839b79 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants