Nextjs Styling
ASecurityAssuming a Next.js App Router project using Tailwind CSS v4: ```bash npm install tailwindcss @tailwindcss/postcss postcss clsx tailwind-merge ``` Create `postcss.config.mjs`: ```js const config = { plugins: { "@tailwindcss/postcss": {}, }, }; export default config; ``` In `app/globals.css`: ```css @import "tailwindcss"; ``` Create `lib/utils.ts`: ```ts import { clsx, type ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return t...
- 584 stars
- 0 votes
- 0 copies
- 5 views
- Added September 5, 2026
Works with
Security analysis
96/100- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill nextjs-styling --agent claude-codeAre you the author of Nextjs Styling?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nextjs-styling-agent-skills-standard)Assuming a Next.js App Router project using Tailwind CSS v4:
```bash
npm install tailwindcss @tailwindcss/postcss postcss clsx tailwind-merge
```
Create `postcss.config.mjs`:
```js
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
```
In `app/globals.css`:
```css
@import "tailwindcss";
```
Create `lib/utils.ts`:
```ts
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
```
Use it in Server Components or client components:
```tsx
import { cn } from "@/lib/utils";
export function Button({ active = false }: { active?: boolean }) {
return (
<button
className={cn(
"rounded-md px-4 py-2 text-sm font-medium",
active && "bg-blue-600 text-white",
!active && "bg-gray-100 text-gray-900",
)}
>
Continue
</button>
);
}
```
Tailwind/shadcn is preferred because it is zero-runtime and RSC-compatible. Use `next/font` for fonts, and `next/image` for images—always specify `width` and `height` or use the `fill` prop.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.