chore: 添加 Cursor 设计系统和项目规范规则
- design-system.mdc: 暗色 token 映射表、禁止白色背景、按钮分层规则 - project-conventions.mdc: 技术栈声明、Tailwind v4 语法、组件和 API 编码规范
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
---
|
||||
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
|
||||
Reference in New Issue
Block a user