chakra-ui / panda

🐼 Universal, Type-Safe, CSS-in-JS Framework for Product Teams ⚡️
https://panda-css.com
MIT License
5.23k stars 236 forks source link

defineUtility doesn't allow custom properties #1736

Closed navaru closed 11 months ago

navaru commented 11 months ago

Description

When trying to define a custom utility using defineUtility it shows a TS error:

Object literal may only specify known properties, and 'br' does not exist in type 'PropertyConfig'

I'm using defineUtility to create a preset.

Link to Reproduction

https://play.panda-css.com/eS03NVeLOh

Steps to reproduce

Check the Config tab in the playground

Panda CSS Version

0.19.0

anubra266 commented 11 months ago

@navaru The type error shows what you're doing wrong.

CleanShot 2023-12-01 at 19 09 39@2x

navaru commented 11 months ago

Oh, ma' bad, I misunderstood. I thought it should with multiple entries. I will use the type instead. Thanks!

import type { UtilityConfig } from "@pandacss/types"
import { defineUtility } from "@pandacss/dev"

const utilities: UtilityConfig = {
  // multiple entries
}

const someUtility = defineUtility({
  // single entry 
})