Skip to content

separator: fix invisible separator#10201

Open
spesnova wants to merge 1 commit intoshadcn-ui:mainfrom
spesnova:spesnova/fix-base-ui-separator
Open

separator: fix invisible separator#10201
spesnova wants to merge 1 commit intoshadcn-ui:mainfrom
spesnova:spesnova/fix-base-ui-separator

Conversation

@spesnova
Copy link
Copy Markdown

What does this PR do?

Fixes the Base UI Separator so it renders with the correct size and becomes visible again.

Motivation / Background

The Base UI Separator sets data-orientation="horizontal" or data-orientation="vertical", but the wrapper was using data-horizontal / data-vertical Tailwind selectors. Because of that mismatch, the size classes were not applied and the separator was rendered with no visible width or height.

Describe how you validated your changes

Ran pnpm registry:build successfully to regenerate and validate the updated Base registry outputs.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 27, 2026

@spesnova is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@mahdirajaee mahdirajaee left a comment

Choose a reason for hiding this comment

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

Good catch. The shorthand data-horizontal: and data-vertical: selectors are Tailwind v4 variants that match the data-horizontal boolean attribute, but Base UI's SeparatorPrimitive renders data-orientation="horizontal" (a key-value attribute, not a boolean). Switching to data-[orientation=horizontal]: and data-[orientation=vertical]: is the correct fix for targeting the actual DOM output.

The change is thorough -- it covers the base component, all five style variants (lyra, maia, mira, nova, vega), the RTL variant for nova, and the corresponding JSON registry files. Both horizontal and vertical orientations are handled consistently. No risk of side effects on existing themes since the previous selectors simply never matched, meaning separators were rendering as zero-dimension elements everywhere for base-ui styles.

One thing to verify: are there other base-ui components in the codebase using the same data-horizontal:/data-vertical: shorthand pattern that might have the same invisible-element bug? Might be worth a quick grep to catch them all in one pass.

@spesnova
Copy link
Copy Markdown
Author

@mahdirajaee

Good point — I had a similar thought.

For this PR, I intentionally scoped it down to Separator to avoid expanding the change surface too much and increasing review overhead.

That said, I agree it's worth checking. I'll do a quick grep across the codebase and share what I find here, and we can decide whether to address them in this PR or follow up separately.

@spesnova
Copy link
Copy Markdown
Author

The same orientation-selector mismatch still exists in following components:

  • UI
    • ButtonGroupSeparator (apps/v4/registry/bases/base/ui/button-group.tsx)
    • Slider (apps/v4/registry/bases/base/ui/slider.tsx)
    • Tabs (apps/v4/registry/bases/base/ui/tabs.tsx)
    • ToggleGroup (apps/v4/registry/bases/base/ui/toggle-group.tsx)
  • Block
    • Sizebar-16 - apps/v4/registry/bases/base/blocks/sidebar-16/components/site-header.tsx
    • Dashboard-01 - apps/v4/registry/bases/base/blocks/dashboard-01/components/site-header.tsx

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.

2 participants