jac-cl-styling

Implements Tailwind v4 setup, conditional classes, cn() utility, and scoped CSS for Jac client components.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/nihalnihalani/jachacks-sf-2026 --skill jac-cl-styling-nihalnihalani
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: jac-cl-styling
Source: https://github.com/nihalnihalani/jachacks-sf-2026/tree/main/plugins/jac-codex/skills/jac-cl-styling
Command: npx skills add https://github.com/nihalnihalani/jachacks-sf-2026 --skill jac-cl-styling-nihalnihalani

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tailwindcss, @tailwindcss/vite, clsx, tailwind-merge.

What problem does it solve? Styling Jac client components involves several distinct approaches—Tailwind v4 setup, scoped CSS annex files, conditional class logic, and theme-aware tokens—and choosing the wrong one (especially in jac-shadcn projects) causes specificity conflicts and broken builds. This Skill provides the correct patterns for each scenario. ## Core Features & Use Cases - Tailwind v4 Setup: Step-by-step configuration of tailwindcss with the Vite plugin via jac.toml, with no tailwind.config.js required. - Scoped CSS Annex Files: Auto-scoped .style.css files paired by base name with components, including :global() opt-out rules. - cn() Utility: A Jac implementation of clsx + tailwind-merge for conditional and merged Tailwind classes. - Semantic Color Tokens: Guidance on theme-aware tokens like text-muted-foreground and bg-card instead of hardcoded hex values. - Use Case: When adding a dark-mode-aware dashboard to a Jac app, use this Skill to wire Tailwind v4, write conditional classes with cn(), and apply semantic tokens that adapt to the active theme. ## Quick Start Set up Tailwind v4 in my Jac project and show me how to write a conditional className for an active tab button using cn().

Frequently Asked Questions about jac-cl-styling

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

FAQPage Schema
How do I set up Tailwind v4 in a Jac project?▼

Install tailwindcss and @tailwindcss/vite with jac install --npm --dev, register the Vite plugin in jac.toml under [client.vite], and add @import "tailwindcss"; to your entry CSS. No tailwind.config.js is needed in v4.

How do I write conditional classNames in Jac components?▼

Use Python-style ternary expressions (A if cond else B) with string concatenation, or use the cn() utility built on clsx and tailwind-merge. Pass each class as a separate argument to cn() for proper merging.

Should I use .style.css files in jac-shadcn projects?▼

No, .style.css annex files are an anti-pattern in jac-shadcn projects because they conflict with the cn() + Tailwind utility system. Use cn() with Tailwind utilities and semantic tokens instead.

How does scoped CSS work in Jac components?▼

Create a .style.css file with the same base name as your component, such as Card.style.css for Card.jac. The compiler hashes declared classes and rewrites matching className literals automatically, with :global() available to opt out of scoping.

Why should I avoid hardcoded colors like text-gray-900 in Tailwind projects?▼

Hardcoded hex and gray values do not adapt to themes or dark mode. Use semantic tokens like text-foreground, bg-card, text-muted-foreground, and text-destructive, which respond to theme changes automatically.