Skip to content

Add type-autocomplete for custom utilities #75

Open
@zslabs

Description

@zslabs

Description

When adding utilities to override certain properties:

backgroundColor: {
  className: 'bg-c',
  values: { 'palettes.gray.20': '#f0f0f0' },
  transform(value) {
    return { backgroundColor: value }
  },
}

And using them in a style:

className={css({
  backgroundColor: 'palette.gray.20'
})}

The value does resolve correctly and render fine on the frontend, but is not part of the typescript autocomplete in VS Code. The only thing that shows up via autocomplete are values stored for the generic colors token, but what I'm attempting to do is set only certain values to be valid for various properties (text-related colors for color, background properties for fill, background-color, etc).

I'm unsure if this is part of the VS Code plugin or Panda CSS in general though 😕

Problem Statement/Justification

This would expand coverage for custom values.

Proposed Solution or API

Update types for properties to take custom utilities into account.

Alternatives

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions