Skip to content

Update template-literals.md #3290

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions website/pages/docs/concepts/template-literals.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Template Literals
description: Panda allows you to write styles using template literals.
title: Template/Object Literals
description: Panda allows you to write styles using template or object literals.
---

# Template Literals
# Template/Object Literals

Panda allows you use the [template literal syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates) as an alternative to the object literal syntax.
Panda allows you use both [template literal syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates) and object literal syntax.

This provides a similar experience to [styled-components](https://styled-components.com/) and [emotion](https://emotion.sh/), except that Panda generates atomic class names instead of a single unique class name.

Expand All @@ -26,6 +26,16 @@ export default defineConfig({
})
```

For object literals, you just have to set `jsxFramework` in your `panda.config.ts` file to `react`:

```ts
// panda.config.ts
export default defineConfig({
// ...
jsxFramework: 'react' // required
})
```

Then run the codegen command to generate the functions:

```sh
Expand Down