Skip to content

Advanced JSX Tracking #2752

Answered by segunadebayo
cgatian asked this question in Q&A
Jul 24, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

This concept is only relevant if your recipe lives in the panda.config not directly in your app.

Recipes can be created in two ways: directly in your app (cva/sva) or in the config.

Recipes defined in the config are 'smart' recipes, meaning only the variants you use will be generated. This also means you can have as many variants as you want, but you pay for the vairants you use in CSS (saving some KB in CSS)

Let's say you create a recipe called 'tabs', and you add it to the config.

defineConfig({
  theme: {
    extend: {
      recipes: {
        // tabs recipe
        tabs: {
          base: {},
          variants: { 
              size: { sm: {}, md: {} }
          },
        },
      },

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@cgatian
Comment options

@cgatian
Comment options

@cgatian
Comment options

@cgatian
Comment options

Answer selected by segunadebayo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants