using-panda-css

Enforce type-safe token() references in Panda CSS styling calls.

1|Updated Oct 21, 2016
One-click install
npx skills add https://github.com/jasonkuhrt/dotfiles --skill using-panda-css
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-panda-css
Source: https://github.com/jasonkuhrt/dotfiles/tree/main/claude/todo/panda-css/skills/using-panda-css
Command: npx skills add https://github.com/jasonkuhrt/dotfiles --skill using-panda-css

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Panda CSS token usage is prone to unsafe string literals; this Skill enforces type-safe token references so design systems remain reliable.

Core Features & Use Cases

  • Type-safe token() enforcement: ensures that token paths are used via token() in css and cva calls.
  • Guidance for common patterns: clarifies when literals are forbidden and when tokens are allowed.
  • Use Case: in a TS project using panda css, refactor css({ maxWidth: 'sizes.container.wide' }) to css({ maxWidth: token('sizes.container.wide') }).

Quick Start

Run a quick validation by scanning your Panda CSS usage for token() replacements and referencing the token docs.

Frequently Asked Questions about using-panda-css

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce type-safe token usage in Panda CSS?

Enforce type-safe token usage in Panda CSS by wrapping token paths with the token() function inside css() and cva() calls. This prevents unsafe string literals and keeps your design system reliable.

Why does Panda CSS require token() for design system tokens?

Panda CSS token() usage prevents unsafe string literals by validating token paths at compile time. This keeps TypeScript design systems reliable by ensuring styling calls reference actual tokens instead of arbitrary strings.

What is the best way to refactor Panda CSS string literals into type-safe tokens?

Refactor Panda CSS string literals by scanning styling calls like css({ maxWidth: 'sizes.container.wide' }) and replacing the string with token('sizes.container.wide'). This enforces type-safe token references across your design system workflow.

Can I use string literals directly in Panda CSS cva() calls?

String literals are forbidden for token paths in Panda CSS cva() calls. You must wrap paths with the token() function to ensure type safety and prevent unreliable design system token references in your TypeScript project.

Do I need TypeScript to use Panda CSS token enforcement?

TypeScript is required for Panda CSS token enforcement because the type safety relies on validating token paths during compilation. The token() function ensures your css() and cva() styling calls reference valid design system tokens.

When should I not use the token() function in Panda CSS?

You should not use token() for literal values that are not part of your design system tokens. The token() function is specifically for enforcing type-safe references to existing token paths within css() and cva() styling calls.