Skip to content

Conversation

@toan-kunaico
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

⚠️ No Changeset found

Latest commit: 9a21679

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

orientation: "horizontal",
loop: false,
selectOnFocus: true
selectOnFocus: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems like something we would just have a boolean for, not needing a bind

* @param orientation - The orientation value ("vertical" or "horizontal")
* @returns CSS string with @custom-variant declarations
*/
function generateOrientationVariant(orientation: OrientationValue): string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to re-think this approach in a more general sense, like generateValueVariant

Also:

/**
 * ui-orientation-vertical: Apply styles when nearest component scope has data-orientation="vertical"
 * Automatically scopes to prevent nested components from inheriting state
 */
@custom-variant ui-orientation-vertical (
  /* Descendant of scope with data-orientation="vertical", stops at nearest scope boundary */
  [data-qds-scope][data-orientation="vertical"] > &,
  [data-qds-scope][data-orientation="vertical"] > :not([data-qds-scope]) &,
  /* Direct match on element itself */
  [data-orientation="vertical"]&
);

/**
 * ui-orientation-horizontal: Apply styles when nearest component scope has data-orientation="horizontal"
 * Automatically scopes to prevent nested components from inheriting state
 */
@custom-variant ui-orientation-horizontal (
  /* Descendant of scope with data-orientation="horizontal", stops at nearest scope boundary */
  [data-qds-scope][data-orientation="horizontal"] > &,
  [data-qds-scope][data-orientation="horizontal"] > :not([data-qds-scope]) &,
  /* Direct match on element itself */
  [data-orientation="horizontal"]&
);

This would quickly get messy needing to create a custom variant for every possible value. Maybe they can provide a "arbitrary variant" the same way they provide a value?

If we don't want to come at it from that angle, I think it would make sense to add two new modifiers:

ui-horizontal and ui-vertical.

Also making sure that we add the not-x versions as well so people can compose them as they would expect.

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.

3 participants