Skip to content

defineRecipe is not type-safe #1691

Description

@Newbie012

Description

When I try to define a CSS recipe using PandaCSS, I do not get errors when using invalid or inappropriate values for properties. For example, borderRadius accepts non-strict tokens and non-existing properties like xxxRadius does not give any error.

Link to Reproduction

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

Steps to reproduce

  1. Import defineRecipe from PandaCSS.
  2. Define a new recipe using defineRecipe.
  3. In the recipe, use an unacceptable value (like a non-strict token) for a CSS property like borderRadius.
  4. Also try adding a non-existing CSS property.
  5. Confirm that no error appears.

JS Framework

React (TS)

Panda CSS Version

0.18.3

Browser

Google Chrome 119

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

Recipe example:

defineRecipe({
    className: "button",
    base: {
        color: "this.color.does.not.exist",
        borderRadius: "asd",
        xxxRadius: "dsa",
    }
})

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