Skip to content

Conversation

@tryone144
Copy link
Contributor

📝 Description

Allow using 'nested' conditions when defining (semantic) tokens. One such example is the existing _hover condition that resolves to

[ "@media (hover: hover)",
  "&:is(:hover, [data-hover]):not(:disabled, [data-disabled])" ]

for nesting the actual selector inside the @media-query.

⛳️ Current behavior (updates)

Using a condition that is not a simple string fails with TypeError: selector.startsWith is not a function here. This is true for the default _hover condition here.

🚀 New behavior

This PR updates the check for conditions that consist of only media-queries to support conditions that are of type string[] (like the default _hover). This then allows users to add and use their own conditions.

Our project would like to overwrite the default _dark selector to only apply on @media not print which requires this feature.

💣 Is this a breaking change (Yes/No):

No

@vercel
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
chakra-ui-storybook ✅ Ready (Inspect) Visit Preview Jul 23, 2025 9:16am
chakra-v3-docs ❌ Failed (Inspect) Jul 23, 2025 9:16am

@changeset-bot
Copy link

changeset-bot bot commented Jul 22, 2025

⚠️ No Changeset found

Latest commit: e7cf9c1

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

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