Agent Instructions: This document is the single source of truth for all UI decisions in this project. All generated components, styling, and layouts must follow the tokens, patterns, and rules defined here. Never invent colors, spacing values, or component structures. When in doubt, reference a token from this file.
General Rules: Agents may request permission to modify token values in the CSS files or improve primitive components when necessary to enhance consistency, accessibility, or overall UI quality.
| Property | Value |
|---|---|
| Theme Name | Particle |
| CSS Framework | Tailwind CSS v4 (@import "tailwindcss") |
| Animation Library | tw-animate-css |
| Component Library | shadcn-vue (CSS: @import "tailwindcss" / @import "tw-animate-css") |
| Dark Mode | Class-based via @custom-variant dark (&:is(.dark *)) |
| Color Model | OKLCH throughout (perceptually uniform, wide gamut) |
| Font — Sans | Inter, sans-serif |
| Font — Serif | Source Serif 4, serif |
| Font — Mono | Fira Code, monospace |
| Base Radius | 0.65rem (~10.4px) |
| Letter Spacing | 0em (no tracking adjustment by default) |
The complete CSS source and token definitions are located at:
./app/assets/css/tailwind.cssThis file is the canonical source of all design tokens.
Every token maps to a Tailwind utility through --color-{token} in @theme inline.
- Always use Tailwind utility classes.
- Never use raw OKLCH, RGB, HEX, or arbitrary color values in component code.
- Never use default Tailwind color utilities such as
text-gray-500orbg-blue-100.
| Token | Tailwind Class | Light | Dark | Usage |
|---|---|---|---|---|
background |
bg-background |
White | Near-black oklch(0.20) |
Page background |
foreground |
text-foreground |
Dark gray oklch(0.32) |
Off-white oklch(0.92) |
Primary body text |
card |
bg-card |
White | oklch(0.27) |
Card surfaces |
card-foreground |
text-card-foreground |
Dark gray | Off-white | Text on cards |
muted |
bg-muted |
Near-white blue tint | Very dark | Subtle backgrounds, table headers |
muted-foreground |
text-muted-foreground |
Mid blue-gray | Light gray | Placeholder text, secondary labels |
border |
border-border |
Light blue-gray | Dark gray oklch(0.37) |
Borders and dividers |
input |
Internal | Same as border |
Same as border |
Input borders |
ring |
ring-ring |
Primary blue | Primary blue | Focus rings |
| Token | Tailwind Class | Value (Light) | Usage |
|---|---|---|---|
primary |
bg-primary / text-primary |
Blue oklch(0.62 0.19 260) |
CTAs, active nav, links |
primary-foreground |
text-primary-foreground |
White | Text/icons on primary |
secondary |
bg-secondary |
Light blue-gray | Secondary buttons, chips |
secondary-foreground |
text-secondary-foreground |
Blue-gray | Text on secondary |
accent |
bg-accent |
Pale blue | Hover states, selected rows |
accent-foreground |
text-accent-foreground |
Deep blue | Text on accent |
success,warning, andinfoare custom extensions added to the base shadcn theme and defined in this project's:rootand.darkblocks.
| Token | Tailwind Class | Meaning | Usage |
|---|---|---|---|
destructive |
bg-destructive / text-destructive |
Error / danger | Delete actions, validation errors |
destructive-foreground |
text-destructive-foreground |
— | Text on destructive backgrounds |
success |
bg-success / text-success |
Success / passing | Published results, Grade A |
success-foreground |
text-success-foreground |
— | Text on success |
warning |
bg-warning / text-warning |
Caution / pending | Pending review, borderline grades |
warning-foreground |
text-warning-foreground |
— | Text on warning |
info |
bg-info / text-info |
Informational | Submitted results, banners |
info-foreground |
text-info-foreground |
— | Text on info |
Sidebar tokens are completely independent. Never substitute bg-muted or bg-accent within the sidebar.
| Token | Tailwind Class | Usage |
|---|---|---|
sidebar |
bg-sidebar |
Sidebar surface |
sidebar-foreground |
text-sidebar-foreground |
Sidebar text |
sidebar-primary |
bg-sidebar-primary |
Active nav item |
sidebar-primary-foreground |
text-sidebar-primary-foreground |
Text on active item |
sidebar-accent |
bg-sidebar-accent |
Hovered nav item |
sidebar-accent-foreground |
text-sidebar-accent-foreground |
Text on hovered item |
sidebar-border |
border-sidebar-border |
Sidebar dividers |
sidebar-ring |
ring-sidebar-ring |
Sidebar focus rings |
Multi-hue accent ramp. The canonical values live in app/assets/css/tailwind.css; the table below
mirrors them.
Always assign chart-1 to the most important data series.
| Token | Light | Dark |
|---|---|---|
chart-1 |
0.6460 0.2220 41.12 |
0.4880 0.2430 264.38 |
chart-2 |
0.6000 0.1180 184.70 |
0.6960 0.1700 162.48 |
chart-3 |
0.3980 0.0700 227.39 |
0.7690 0.1880 70.08 |
chart-4 |
0.8280 0.1890 84.43 |
0.6270 0.2650 303.90 |
chart-5 |
0.7690 0.1880 70.08 |
0.6450 0.2460 16.44 |
| Token | Tailwind Class | Value | Usage |
|---|---|---|---|
radius-sm |
rounded-sm |
calc(var(--radius) - 4px) |
Small badges, inline tags |
radius-md |
rounded-md |
calc(var(--radius) - 2px) |
Buttons, inputs |
radius-lg |
rounded-lg |
var(--radius) (0.65rem) |
Cards, modals, popovers |
radius-xl |
rounded-xl |
calc(var(--radius) + 4px) |
Large overlays, sheets |
| Utility | rounded-full |
9999px |
Pills, avatars |
All radius tokens derive from the single
--radius: 0.65remcustom property intailwind.css.
All shadows use low-opacity black and are designed to work in both light and dark modes.
| Token | Tailwind Class | Usage |
|---|---|---|
shadow-2xs |
shadow-2xs |
Minimal hover elevation |
shadow-xs |
shadow-xs |
Subtle surfaces |
shadow-sm |
shadow-sm |
Default card elevation |
shadow |
shadow |
Dropdowns, popovers |
shadow-md |
shadow-md |
Floating actions |
shadow-lg |
shadow-lg |
Dialogs, modals |
shadow-xl |
shadow-xl |
Sheets |
shadow-2xl |
shadow-2xl |
Reserved for critical UI only |
| Token | Value | Usage |
|---|---|---|
font-sans |
Inter, sans-serif |
Default UI text |
font-serif |
Source Serif 4, serif |
Long-form content |
font-mono |
Fira Code, monospace |
IDs, codes, score values |
font-heading |
Same as font-sans |
Headings |
| Class | Size | Weight | Line Height | Usage |
|---|---|---|---|---|
text-4xl |
2.25rem | 700 | 1.1 | School name on report card |
text-3xl |
1.875rem | 600 | 1.2 | Page titles |
text-2xl |
1.5rem | 600 | 1.3 | Section headings |
text-xl |
1.25rem | 500 | 1.4 | Modal titles |
text-lg |
1.125rem | 500 | 1.5 | Emphasized labels |
text-base |
1rem | 400 | 1.6 | Default body text |
text-sm |
0.875rem | 400 | 1.5 | Table cells |
text-xs |
0.75rem | 400 | 1.4 | Captions, badges |
Base spacing unit:
--spacing: 0.25rem;Standard Tailwind spacing scale applies.
| Class | Value | Usage |
|---|---|---|
p-1 |
0.25rem | Icon padding |
p-2 |
0.5rem | Compact badges |
p-3 |
0.75rem | Compact inputs |
p-4 |
1rem | Default component padding |
p-6 |
1.5rem | Card padding |
p-8 |
2rem | Page section padding |
gap-2 |
0.5rem | Icon/text spacing |
gap-4 |
1rem | Form spacing |
gap-6 |
1.5rem | Grid spacing |
Components use shadcn-vue (Reka UI) primitives located in:
app/components/ui- Extract large or reusable sections into dedicated components.
- Prefer reusable composition over duplicated markup.
- Use props extensively for customization and reuse.
- Shared wrappers around shadcn components are encouraged.
- Examples include:
- Confirm dialogs
- Empty states
- Data tables
- Dashboard stat cards
- Section headers
All components inside app/components/ui/** are automatically prefixed with Ui.
Examples:
| File | Usage |
|---|---|
components/ui/button/Button.vue |
<UiButton /> |
components/form/FormField.vue |
<FormField /> |
This behavior relies on Nuxt's pathPrefix component configuration.
- Primary buttons are reserved for the main action on a page or section.
- Avoid multiple primary buttons in the same visual area.
- Icon-only buttons must include
aria-label.
<!-- Primary -->
<UiButton>Save Result</UiButton>
<!-- Secondary -->
<UiButton variant="secondary">
View Scoresheet
</UiButton>
<!-- Outline -->
<UiButton variant="outline">
Export PDF
</UiButton>
<!-- Ghost -->
<UiButton variant="ghost" :icon="ICONS.edit" aria-label="Edit result" />
<!-- Icon left -->
<UiButton variant="destructive" :icon="ICONS.delete">
Delete Student
</UiButton>
<!-- Icon right -->
<UiButton :icon-right="ICONS.forward">
Go to Dashboard
</UiButton>
<!-- Loading -->
<UiButton loading>
Saving...
</UiButton>Create reusable card wrappers where appropriate.
<UiCard class="shadow-sm">
<UiCardHeader>
<UiCardTitle>JSS1A — 1st Term Result</UiCardTitle>
<UiCardDescription>
2025/2026 Academic Session
</UiCardDescription>
</UiCardHeader>
<UiCardContent>
<!-- content -->
</UiCardContent>
<UiCardFooter
class="flex justify-end gap-3 border-t border-border pt-4"
>
<Button variant="outline">
Review
</Button>
<Button>
Approve & Publish
</Button>
</UiCardFooter>
</UiCard>Use these exact class combinations for result lifecycle states.
<!-- Draft -->
<UiBadge variant="outline" class="border-border text-muted-foreground">
Draft
</UiBadge>
<!-- Submitted -->
<UiBadge class="border border-info/30 bg-info/15 text-info">
Submitted
</UiBadge>
<!-- Pending -->
<UiBadge class="border border-warning/30 bg-warning/15 text-warning">
Pending Review
</UiBadge>
<!-- Published -->
<UiBadge class="border border-success/30 bg-success/15 text-success">
Published
</UiBadge>
<!-- Rejected -->
<UiBadge class="border border-destructive/30 bg-destructive/15 text-destructive">
Rejected
</UiBadge>All forms are built on FormKit (@formkit/nuxt with autoImport: true). Config lives in app/formkit.config.ts, custom inputs are registered there with createInput, and FormKit's default styling is themed to shadcn-vue in app/assets/css/formkit-shadcn.css. This provides:
- Consistent styling
- Validation handling
- Accessibility support (labels, help text, error messaging)
- Shared layouts and spacing
- Tight integration with shadcn-vue primitives
- Always wrap forms in
<FormKit type="form"> - Pass initial values with
:value(orv-modelfor a local writable copy) — never bindv-modeldirectly to TanStack Querydata, which is wrapped inreadonly() - Use FormKit input types and the registered custom inputs (
_select,_tags,<FormKitPassword />) instead of raw inputs - Client-side validation should be handled through FormKit's
validationprop and custom rules registered inapp/formkit.config.ts - Derive payload types from the shared Zod schemas in
shared/validators/**withz.infer; the same schemas are enforced server-side by oRPC - Never manually wire labels, help text, or errors — FormKit renders them from the
label/helpprops and validation state - All form spacing should use
space-y-6unless a tighter layout is explicitly needed - Use
gap-4for grouped form controls - Disable fields during submission with
<fieldset :disabled="isSubmitting">and reflect loading on the submit<UiButton>
Use FormKit for all forms and the shared Zod schemas in shared/validators/** as the source of truth for payload shapes. Always check that folder first: if a schema (and its z.infer type) already exists for the form, import the type rather than redefining it. If it needs changing, edit the existing schema after user approval.
<script setup lang="ts">
import { type UpsertStudentInput } from "~~/shared/validators/academic"
const isSubmitting = ref(false)
async function onSubmit(payload: UpsertStudentInput) {
isSubmitting.value = true
try {
await createStudent.mutateAsync(payload)
} finally {
isSubmitting.value = false
}
}
const classOptions = [
{ label: "JSS1A", value: "jss1a" },
{ label: "JSS1B", value: "jss1b" }
]
</script>
<template>
<FormKit type="form" class="space-y-6" :actions="false" @submit="onSubmit">
<fieldset :disabled="isSubmitting">
<FormKit
name="name"
label="Student Name *"
placeholder="Ahmed Musa"
:prefix-icon="ICONS.student"
validation="required"
/>
<FormKit
name="studentId"
label="Student ID *"
placeholder="STU-2026-001"
:prefix-icon="ICONS.credentials"
validation="required"
/>
<FormKit
type="_select"
name="classId"
label="Class *"
placeholder="Select class"
:options="classOptions"
:prefix-icon="ICONS.class"
validation="required"
/>
<div class="flex justify-end">
<UiButton type="submit" :loading="isSubmitting"> Add Student </UiButton>
</div>
</fieldset>
</FormKit>
</template>FormKit ships all native input types; use the type that matches the data and the registered custom inputs for shadcn-vue controls.
| Type / Component | Purpose |
|---|---|
form |
Form wrapper; handles submit and validation |
text |
Text |
email |
|
password |
Password (use <FormKitPassword /> for the toggle) |
number |
Numeric values |
textarea |
Long-form text |
checkbox |
Boolean agreement/input |
select |
Native select dropdown |
_select |
shadcn-vue select dropdown (custom input) |
_tags |
Array/tag input (custom input) |
- Labels should be concise and sentence-cased
- Required fields should include
*
<FormKit type="email" name="email" label="Email address *" />Descriptions should provide context, constraints, or guidance.
<FormKitPassword
name="password"
label="Password"
help="Use a mix of letters, numbers, and symbols."
/>- Use realistic examples
- Avoid generic placeholders like
"Enter value"
placeholder="Ada Lovelace"All icons must come from the shared ICONS constant.
Never hardcode icon names inline.
<FormKit type="email" name="email" :prefix-icon="ICONS.email" />Custom inputs are registered centrally in app/formkit.config.ts with createInput, so they can be used anywhere as a FormKit type.
app/components/FormKit/Select.vue wraps UiSelect. Accepts options ({ label, value, disabled? }[]), placeholder, multiple, and disabled.
<FormKit
type="_select"
name="classId"
label="Class"
placeholder="Select a class for the student"
:options="classes"
validation="required"
/>app/components/FormKit/Tags.vue wraps UiTagsInput. Accepts addOnKeys, placeholder, and disabled.
<FormKit
type="_tags"
name="subjectTags"
label="Subject Tags"
placeholder="Create tags for subjects"
help="Subject tags are used to filter and manage subjects"
/>app/components/FormKit/Password.vue is a thin wrapper used directly as <FormKitPassword />. It renders a password field with a visibility toggle.
<FormKitPassword name="password" label="Password" validation="required" />-
Validation messages must use:
text-destructive text-xs
FormKit's themed message styling in
app/assets/css/formkit-shadcn.css(.formkit-message) already applies--destructiveandtext-xs; only add this class when building custom message markup. -
Client-side validation should occur through FormKit's
validationprop or custom rules registered inapp/formkit.config.ts -
Prefer the shared Zod schemas in
shared/validators/**for complex forms — derive payload types withz.inferand let oRPC enforce them server-side -
Async validation should show loading indicators when necessary
| Scenario | Recommended Layout |
|---|---|
| Simple forms | space-y-6 |
| Compact forms | space-y-4 |
| Two-column forms | grid md:grid-cols-2 gap-4 |
| Inline controls | flex items-center gap-2 |
| Form actions | flex justify-end gap-3 |
- The primary submit button should usually be the right-most action
- Destructive actions must use confirmation dialogs
- Loading states should disable submission
<UiButton type="submit" loading>
Saving...
</UiButton>-
Every form field must have:
- a label
- accessible error messaging
- keyboard support
-
Icon-only controls require
aria-label -
Required fields should be communicated both:
- visually
- semantically
-
Forms must remain fully usable on mobile devices
Create reusable confirm dialog wrappers for destructive or irreversible actions.
<UiEmptyState
:icon="ICONS.empty"
title="No students to display"
description="You have not created any students yet."
/>Create reusable stat cards for analytics and dashboard metrics.
Recommended structure:
- Icon
- Label
- Value
- Trend indicator (optional)
Agents must consult this table before assigning any color classes.
Never use arbitrary Tailwind colors.
| Scenario | Classes |
|---|---|
| Primary CTA | bg-primary text-primary-foreground |
| Page background | bg-background |
| Card surface | bg-card text-card-foreground shadow-sm |
| Table header | bg-muted/50 |
| Table row hover | hover:bg-accent/40 transition-colors duration-150 |
| Selected row | bg-accent text-accent-foreground |
| Sidebar background | bg-sidebar text-sidebar-foreground |
| Active sidebar item | bg-sidebar-primary text-sidebar-primary-foreground rounded-md |
| Hovered sidebar item | bg-sidebar-accent text-sidebar-accent-foreground rounded-md |
| Secondary text | text-muted-foreground |
| IDs / usernames | font-mono text-xs text-muted-foreground tabular-nums |
| Validation error | text-destructive text-xs |
| Destructive action | bg-destructive text-destructive-foreground |
| Focus ring | focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 |
| Context | Max Width | Padding |
|---|---|---|
| Dashboard pages | max-w-7xl |
px-4 sm:px-6 lg:px-8 py-8 |
| Settings pages | max-w-3xl |
px-4 py-8 |
| Auth pages | max-w-sm |
px-4 py-8 |
| Default modal | sm:max-w-lg |
Handled by shadcn |
| Wide modal | sm:max-w-2xl |
Handled by shadcn |
| Report card preview | max-w-3xl |
px-4 sm:px-0 |
The report card must render cleanly in A4 portrait print format.
- Must remain readable at 100% zoom.
- Must avoid horizontal overflow.
- Print output must prioritize clarity over visual effects.
Use Lucide and Tabler icons through nuxt-icon.
-
Inline icons:
size-4 -
Sidebar/navigation icons:
size-5 -
Never hardcode icon names directly in components.
-
Always reference icons through:
ICONS.someKey
Icons are defined in:
shared/constants/icons.tsThe ICONS constant is auto-imported by Nuxt, so explicit imports are unnecessary.
<Icon :name="ICONS.class" />
<UiButton text="Add Student" :icon="ICONS.add" />-
All interactive elements must include:
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
-
Never rely solely on color to communicate status.
-
Every
<UiTable>must include:aria-label- or a
<caption>
-
Icon-only buttons must include
aria-label. -
Minimum tap target:
min-h-9 min-w-9
-
Report cards must remain readable without zooming or horizontal scrolling.
| Breakpoint | Min Width | Behavior |
|---|---|---|
| Default | 0px |
Single-column layout |
sm |
640px |
Minor layout improvements |
md |
768px |
Two-column forms |
lg |
1024px |
Full sidebar and tables |
xl |
1280px |
4-column dashboard stats |
app
├── assets/
│ └── css/
│ ├── tailwind.css # CSS entry (imported by nuxt.config.ts)
│ └── formkit-shadcn.css # FormKit styling
│
├── components/
│ ├── Ui/ # shadcn-vue primitives (Ui prefix)
│ ├── FormKit/ # FormKit custom inputs
│ ├── App/ # shared application components
│ ├── Page/
│ ├── Sidebar/
│ └── ... # domain folders: Class, Session, Subject, Student, Teacher,
│ # Result, Scoresheet, ReportCard, Settings, Dashboard- Do not manually modify generated shadcn components unless necessary.
- Shared application-level components belong in
components/App. - Domain-specific components belong in namespaced folders.
| ✅ Do | ❌ Don't |
|---|---|
| Use design tokens via Tailwind utilities | Hardcode colors |
Use text-muted-foreground for secondary text |
Use arbitrary gray utilities |
Use font-mono tabular-nums for numeric data |
Mix font families randomly |
| Confirm destructive actions with dialogs | Delete immediately |
| Use sidebar-specific tokens in sidebars | Use generic background tokens |
Use shadow-sm for resting cards |
Use excessive shadows/glows |
Use transition-colors duration-150 |
Use JS for simple hover transitions |
Use rounded-lg as the default radius |
Use oversized radii like rounded-3xl |
| Keep icon sizing consistent | Scale icons inconsistently |
DESIGN.md — Particle Theme v1.0 | Tailwind CSS v4 + shadcn-vue (Reka UI) | 2026