-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix(slider, scroll-area): use correct data-orientation attribute selectors #9380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(slider, scroll-area): use correct data-orientation attribute selectors #9380
Conversation
…ctors Fixes shadcn-ui#9196 - replaced `data-horizontal:` with `data-[orientation=horizontal]:` - replaced `data-vertical:` with `data-[orientation=vertical]:` the components output `data-orientation="horizontal"` (a key-value attribute), but the old selectors `data-horizontal:` expected a boolean attribute. this caused scrollbars not to display and slider orientation styles to fail.
|
@sunnypatell is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where Tailwind data attribute selectors for scroll-area and slider components were using an incorrect syntax that prevented styles from being applied. The components output data-orientation="horizontal" or data-orientation="vertical" as key-value attributes, but the old selectors expected boolean attributes.
Changes:
- Updated data attribute selectors from
data-horizontal:anddata-vertical:todata-[orientation=horizontal]:anddata-[orientation=vertical]:in all 5 theme CSS files - Updated slider components in both base and radix implementations to use the correct data attribute selector syntax
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/v4/registry/styles/style-vega.css | Fixed scroll-area-scrollbar and slider data attribute selectors for vega theme |
| apps/v4/registry/styles/style-nova.css | Fixed scroll-area-scrollbar and slider data attribute selectors for nova theme |
| apps/v4/registry/styles/style-mira.css | Fixed scroll-area-scrollbar and slider data attribute selectors for mira theme |
| apps/v4/registry/styles/style-maia.css | Fixed scroll-area-scrollbar and slider data attribute selectors for maia theme |
| apps/v4/registry/styles/style-lyra.css | Fixed scroll-area-scrollbar and slider data attribute selectors for lyra theme |
| apps/v4/registry/bases/radix/ui/slider.tsx | Updated slider component data attribute selectors to match correct syntax in radix implementation |
| apps/v4/registry/bases/base/ui/slider.tsx | Updated slider component data attribute selectors to match correct syntax in base implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This is actually now handled by the new custom variants in tailwind.css: ui/packages/shadcn/src/tailwind.css Lines 76 to 86 in f1b7102
A heads up would have been nice 😂 |
Summary
data-horizontal:withdata-[orientation=horizontal]:data-vertical:withdata-[orientation=vertical]:Fixes #9196
Problem
the components output
data-orientation="horizontal"(a key-value attribute), but the old selectorsdata-horizontal:expected a boolean attribute likedata-horizontalto be present.this caused:
Changes
slider.tsx (base + radix)
style-*.css (all 5 themes)
Test plan