Files
no-whatever/.cursor/rules/project-conventions.mdc
T
kurihada 11d872e72a chore: 添加 Cursor 设计系统和项目规范规则
- design-system.mdc: 暗色 token 映射表、禁止白色背景、按钮分层规则
- project-conventions.mdc: 技术栈声明、Tailwind v4 语法、组件和 API 编码规范
2026-02-26 11:27:23 +08:00

35 lines
1.0 KiB
Plaintext

---
description: Project-wide coding conventions for NoWhatever
alwaysApply: true
---
# NoWhatever Project Conventions
## Tech Stack
- **Framework**: Next.js App Router (all pages are `"use client"`)
- **Database**: Prisma + SQLite
- **Styling**: Tailwind CSS v4 (use `bg-linear-to-*` NOT `bg-gradient-to-*`)
- **Animation**: framer-motion
- **Icons**: lucide-react
- **Effects**: canvas-confetti
## Tailwind v4 Syntax
- Gradients: `bg-linear-to-br` (not `bg-gradient-to-br`)
- Arbitrary values: prefer Tailwind built-in classes over `[]` when possible (e.g. `max-w-20` not `max-w-[5rem]`)
## Component Patterns
- Page components export `default function PageName()`
- Use `useCallback` for event handlers passed as props
- Use `motion.*` from framer-motion for animated elements
- Mobile-first, `min-h-dvh` for full-height pages
- `overflow-y-auto scrollbar-none` for scrollable pages
## API Routes
- Located in `src/app/api/`
- Return `NextResponse.json()` with appropriate status codes
- Always handle errors with try/catch