Skip to content
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

Better app config theme auto-complete #1869

Closed
davestewart opened this issue Jun 13, 2024 · 6 comments · Fixed by #1870
Closed

Better app config theme auto-complete #1869

davestewart opened this issue Jun 13, 2024 · 6 comments · Fixed by #1870
Labels
enhancement New feature or request

Comments

@davestewart
Copy link
Contributor

Description

Hello.

It seems the auto-complete for the global component ui theming is shallow.

We solved this in our own project with a that more accurately deeply-nests, whilst also allowing optional string properties (for variants and such like)

CleanShot 2024-06-13 at 11 01 50

It also navigates to the source on a Cmd+Click which is great!

I had a dig into the source and it seems it can be solved at source actually-deep DeepPartial implementation:

type UI = {
  primary?: string
  gray?: string
  colors?: string[]
  strategy?: Strategy
  [key: string]: any
} & FullyDeepPartial<typeof config> // <-- fix this one here

I'm happy to PR this fix.

Additional context

No response

@davestewart davestewart added the enhancement New feature or request label Jun 13, 2024
Copy link
Member

I'm not sure to fully understand what you fixed, everything seems to work fine for me 🤔
CleanShot 2024-06-13 at 12.43.26@2x.png
CleanShot 2024-06-13 at 12.43.19@2x.png

@davestewart
Copy link
Contributor Author

Hi Ben,

Oh! We're not getting that in our project, and there's a few of us working on this.

Thanks for clarifying; let me check with the others and see.

Copy link
Member

Can it be caused by your defineThemeConfig wrapper? 🤔

@davestewart
Copy link
Contributor Author

I mean, that was why we added it.

Top level:

CleanShot 2024-06-13 at 12 04 38

Button props:

CleanShot 2024-06-13 at 12 05 16

Copy link
Member

This is indeed really strange as it should work out of the box. Would you be able to create a small reproduction? 😬

@davestewart
Copy link
Contributor Author

davestewart commented Jun 13, 2024

So I just tried it out in my Nuxt UI fork, and you are right – it does work with the original DeepPartial type.

Sorry to waste your time on this. Maybe it is a tooling / IDE thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants