Skip to content

fix: generated CssVarKeys type cannot provide autocomplete correctly #3177

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hyp3rflow
Copy link

Closes #

📝 Description

Fix issue where generated CssVarKeys type cannot provide autocomplete correctly

⛳️ Current behavior (updates)

It provides suggestion as if it is just string type.

🚀 New behavior

Correctly provides declared css variable keys along with string type.

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

📝 Additional Information

You can easily see the difference of this PR in ts playground: https://www.typescriptlang.org/play/?#code/C4TwDgpgBGDCDO8BqBDATgORQW2gXigHIBrCEAWhUKgB8jSKAjaugCnmDQEsA7AcygAyKAG8AvgEoAUKEgwEydAGkyUAgANy5ACQi4iVJhwQx6qQHpzUawD0A-FJnhoPBYay419MpRbemhE5yrgbKqhpauiGKRrimtFCaOiIc3PzxwuIWVrZ2QA

Copy link

changeset-bot bot commented Mar 13, 2025

🦋 Changeset detected

Latest commit: ae6836a

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

This PR includes changesets to release 20 packages
Name Type
@pandacss/generator Patch
@pandacss/node Patch
@pandacss/parser Patch
@pandacss/reporter Patch
@pandacss/astro-plugin-studio Patch
@pandacss/dev Patch
@pandacss/postcss Patch
@pandacss/studio Patch
@pandacss/config Patch
@pandacss/core Patch
@pandacss/extractor Patch
@pandacss/is-valid-prop Patch
@pandacss/logger Patch
@pandacss/preset-atlaskit Patch
@pandacss/preset-base Patch
@pandacss/preset-open-props Patch
@pandacss/preset-panda Patch
@pandacss/shared Patch
@pandacss/token-dictionary Patch
@pandacss/types 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

Copy link

vercel bot commented Mar 13, 2025

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

Name Status Preview Updated (UTC)
panda-docs ✅ Ready (Inspect) Visit Preview Mar 13, 2025 6:15am
panda-playground ✅ Ready (Inspect) Visit Preview Mar 13, 2025 6:15am
panda-studio 🛑 Canceled (Inspect) Mar 13, 2025 6:15am

@@ -8,8 +8,8 @@ type AnyString = (string & {})
type CssVars = `var(--${string})`
type CssVarValue = ConditionalValue<Token | AnyString | (number & {})>

type CssVarName = | AnyString
type CssVarKeys = `--${CssVarName}`
type CssVarName =
Copy link
Author

Choose a reason for hiding this comment

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

How can I prevent this empty type? I tried to fix this by editting style-props.ts, but it didn't work.

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