| name | Mandu Styling |
| description | Tailwind CSS v4 integration and Island styling patterns for Mandu Framework |
| metadata | {"version":"2.0.0","author":"mandu","tailwind":"v4.1+"} |
| globs | ["**/*.css","**/*.module.css","app/globals.css"] |
Mandu Styling Skill
Mandu Island ์ํคํ
์ฒ์ ์ต์ ํ๋ Tailwind CSS v4 ์คํ์ผ๋ง ๊ฐ์ด๋์
๋๋ค.
Agent Workflow Contract
This skill is a Domain addendum. It must not replace mandu-agent-workflow.
Use it only after mandu.agent.plan selects styling, design, UI, hydration, or component domains.
Canonical workflow step: plan -> apply -> verify.
Preferred MCP tools:
| Step | Tools |
|---|
| plan | mandu.agent.plan, mandu.design.get |
| apply | mandu.agent.apply, mandu.design.patch |
| verify | mandu.agent.verify, mandu.design.check, mandu.lint |
| repair | mandu.agent.repair |
Allowed file edits:
- CSS files named in the plan, especially
app/globals.css
- Component className changes scoped to the target UI
- Theme tokens only after inspecting the project's design source
Verification command:
mandu agent verify --changed --json --write
Common failures:
- Installing or changing styling stacks before checking the existing project style
- Editing broad theme tokens for a local component issue
- Skipping design/lint verification after Tailwind v4 syntax changes
Repair path:
mandu agent repair --from .mandu/agent-verify.json --json
ํต์ฌ ์์น
- Zero-Runtime: ๋น๋ ํ์ CSS ์์ฑ (SSR ํธํ)
- CSS-First: JavaScript ์ค์ ๋์ CSS์์ ํ
๋ง ์ ์
- Island ๊ฒฉ๋ฆฌ: ์ปดํฌ๋ํธ ๊ฐ ์คํ์ผ ์ถฉ๋ ๋ฐฉ์ง
- Auto Integration: Mandu๊ฐ Tailwind v4 ์๋ ๊ฐ์ง ๋ฐ ๋น๋
๊ถ์ฅ ์คํ
Primary: Tailwind CSS v4 + clsx/tailwind-merge
Alternative: CSS Modules (์ต์ ์์กด์ฑ)
Setup Examples
Use these examples only after mandu.agent.plan selects styling setup or migration.
1. ์ค์น
bun add -d tailwindcss@^4.1 @tailwindcss/cli@^4.1
bun add clsx tailwind-merge
2. app/globals.css
@import "tailwindcss";
@theme {
--color-primary: hsl(222.2 47.4% 11.2%);
--color-primary-foreground: hsl(210 40% 98%);
--color-background: hsl(0 0% 100%);
--color-foreground: hsl(222.2 84% 4.9%);
--radius-md: 0.5rem;
--font-sans: 'Inter', system-ui, sans-serif;
}
body {
background-color: var(--color-background);
color: var(--color-foreground);
}
3. Mandu ์๋ ํตํฉ
mandu dev ์คํ ์:
โโ @import "tailwindcss" ๊ฐ์ง
โโ Tailwind CLI --watch ์๋ ์์
โโ ์ถ๋ ฅ: .mandu/client/globals.css
โโ SSR์์ <link> ์๋ ์ฃผ์
โโ CSS ๋ณ๊ฒฝ ์ HMR ํซ ๋ฆฌ๋ก๋
Island ์คํ์ผ๋ง
"use client";
import { cn } from "@/shared/lib/utils";
export function CounterIsland({ variant = "default" }) {
return (
<button className={cn(
"px-4 py-2 rounded-md font-medium transition-colors",
variant === "default"
? "bg-primary text-primary-foreground hover:bg-primary/90"
: "border border-primary text-primary hover:bg-primary/10"
)}>
Count: 0
</button>
);
}
cn ์ ํธ๋ฆฌํฐ
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
Custom Utilities
@utility text-balance {
text-wrap: balance;
}
@utility scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar { display: none; }
}
v4 ์ฃผ์ ๋ณ๊ฒฝ์ฌํญ
| v3 | v4 |
|---|
@tailwind base/utilities | @import "tailwindcss" |
tailwind.config.ts | @theme { } in CSS |
!bg-red-500 | bg-red-500! |
@layer utilities | @utility |
bg-[--var] | bg-(--var) |
์์ธํ ๋ด์ฉ์ rules/style-tailwind-v4-gotchas.md ์ฐธ์กฐ
๊ท์น ์นดํ
๊ณ ๋ฆฌ
| Category | Description | Rules |
|---|
| Setup | Tailwind v4 ์ค์ | 1 |
| Gotchas | v4 ์ฃผ์์ฌํญ/๋ง์ด๊ทธ๋ ์ด์
| 1 |
| Island | Island ์คํ์ผ ํจํด | 3 |
| Component | ์ปดํฌ๋ํธ ์คํ์ผ | 3 |
| Performance | ์ต์ ํ | 2 |
| Theme | ํ
๋ง/๋คํฌ๋ชจ๋ | 1 |
โ ์ธ๋ถ ๊ท์น์ rules/ ํด๋ ์ฐธ์กฐ
Browser Support
Safari 16.4+ | Chrome 111+ | Firefox 128+
IE ๋ฐ ๊ตฌํ ๋ธ๋ผ์ฐ์ ๋ฏธ์ง์. ๋ ๊ฑฐ์ ํ๋ก์ ํธ๋ Tailwind v3 ์ ์ง ๊ถ์ฅ.
Reference: Tailwind CSS v4