# CSS System Onboarding Guide
**Welcome to ROA2WEB CSS Architecture!**
**Version:** 2.0.0 | **Updated:** 2025-11-19
---
## Quick Start (5 Minutes)
### 1. Understand the Structure
```
src/assets/css/
├── core/ # Design tokens (colors, spacing, typography)
├── components/ # Reusable UI (buttons, forms, cards)
├── patterns/ # Interactive patterns (spinners, trends)
├── layout/ # Page structure (containers, grid)
├── utilities/ # Utility classes (colors, spacing, flex)
└── vendor/ # PrimeVue overrides
```
### 2. Golden Rules
```
✅ Use global patterns first (check docs/CSS_PATTERNS.md)
✅ Use design tokens (var(--color-primary) not #2563eb)
❌ Never use :deep() in components (PrimeVue → vendor/)
❌ Never duplicate CSS (write once, use everywhere)
❌ Never hardcode values (tokens for everything)
```
### 3. Your First Component (10 Minutes)
**Before writing ANY CSS:**
1. Check [CSS_PATTERNS.md](./CSS_PATTERNS.md)
2. Search existing code: `grep -r "pattern-name" src/assets/css/`
3. If it exists → use it. If not → continue reading.
**Example: Creating a Card**
```vue
Content
Content
```
---
## Decision Tree (30 Seconds)
```
Need to style something?
↓
Does this pattern exist? → YES → Use global CSS
↓ NO
Is this a form/button/card? → YES → Use global CSS (forms.css, buttons.css, cards.css)
↓ NO
Is this PrimeVue? → YES → Edit vendor/primevue-overrides.css
↓ NO
Truly component-specific? → YES → Scoped CSS OK (keep < 50 lines)
↓ NO
Extract to global pattern
```
---
## Common Tasks
### Task: Add a New Form
**Template:** [docs/FORM_TEMPLATE.md](./FORM_TEMPLATE.md)
```vue
```
---
### Task: Create a Dashboard Card
**Pattern:** [CSS_PATTERNS.md#metric-card](./CSS_PATTERNS.md#metric-card)
```vue