# Farvist — rules for your AI assistant
# Drop this in your project (e.g. as .cursorrules) so Cursor/Copilot/Claude generate correct Farvist UI.

You are building UI with Farvist, a lightweight glassmorphism CSS framework (https://farvist.com).

Setup
- Drop-in CSS: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/farvist/dist/farvist.min.css">
- Optional JS (modals, tabs, toasts, theme, copy buttons, ARIA): <script src="https://cdn.jsdelivr.net/npm/farvist/assets/farvist.js" defer></script>
- Or: npm i farvist
- Three builds, same class names: farvist.min.css (~21 KB gzip, everything) / farvist-slim.min.css (~19 KB, no AI kit: chat, prompt, status, prose, tool-call, reasoning, command, diff, suggestions, attachment, snippet) / farvist-ai.min.css (~6.6 KB, ONLY the AI-interface kit — use it to ADD a chat/agent UI to a project already styled with Tailwind/Bootstrap/custom CSS; it ships no reset/grid/utilities, assumes box-sizing: border-box and a 16px root, and on a light host page the UI should be wrapped in data-theme="light"). On a Tailwind v3 host ALSO load farvist-ai-compat.css after the Tailwind build (v3's un-layered preflight otherwise strips the kit's borders/button styling). Load it on a Bootstrap host too — ALWAYS, not conditionally: the kit’s own buttons use class="btn" and Bootstrap’s .btn is un-layered, so it overrides their padding/weight/radius/glass chrome no matter how the host writes its markup. Tailwind v4's preflight is layered and needs nothing.

Conventions
- Components + utilities, like Bootstrap's class model (NOT Tailwind atomic-only). Prefer Farvist classes over hand-written CSS.
- Dark theme by default; add data-theme="light" to <html> to switch. Give the page a rich background so the glass reads, e.g. <body class="bg-mesh-aurora"> (also: bg-mesh-sunset/ocean/nebula, bg-grid, bg-dots, bg-spotlight).
- Re-branding: override --fv-primary / --fv-accent / --fv-info on :root and EVERYTHING follows at runtime (gradients, glows, meshes, hover states, focus rings). Add --fv-primary-text (readable tint on dark) and --fv-{color}-contrast (text on fills) when the brand flips brightness. Never re-color by overriding component CSS.
- Skins: prebuilt AA-gated theme packs — <html data-theme="synthwave|cyber|noir|forest|dawn"> ("dawn" is light). JS: Farvist.theme('name') applies + persists; <button data-fv-theme-cycle="synthwave,cyber,noir"> cycles through them.
- Command palette (⌘K): <dialog class="command"> with .command-search > .command-input, .command-list > .command-item (data-fv-command="url|#anchor|action", optional data-fv-keywords), .command-group, .command-empty, .command-hint. Open via data-fv-open="#cmd" / ⌘K / Farvist.command('#cmd'); a URL/#anchor navigates, else fires an fv:command event.
- More AI UI: code diffs = .diff > .diff-header (+ .diff-stat) + pre.diff-body > .diff-line(.diff-add|.diff-del|.diff-hunk) — keep the +/− chars IN the content. Prompt starters = .suggestions > button.suggestion. File pills = .attachment > .attachment-name/.attachment-meta/.attachment-remove. Named code blocks = hand-authored .snippet-wrap > .snippet-header (.snippet-title + .snippet-lang) + pre.snippet. Streaming text = Farvist.stream(el, text) (typed with the caret, reduced-motion safe).
- Colors: primary, secondary, success, danger, warning, info, accent, light, dark — used as suffixes: btn-primary, text-success, bg-accent, badge-soft-info.
- Breakpoints: sm 576, md 768, lg 992, xl 1200 — infix after the prefix: col-md-6, d-lg-flex, text-md-center.
- Spacing 0–8 scale: p-4 = 1rem, m-0, gap-3 = .75rem, py-6.
- Grid: <div class="row gy-3"><div class="col-12 col-md-6">…</div></div>.
- JS hooks: data-fv-open="#id" / data-fv-dismiss (modal), data-fv-tab="#panel" (tabs), data-fv-theme-toggle, data-fv-nav-toggle, data-tooltip="…". API: Farvist.toast({title,variant}), Farvist.copy(text), Farvist.enhance() (call after injecting DOM).
- Icons: <svg class="icon"><use href="assets/icons/farvist-icons.svg#i-NAME"/></svg> (inherits currentColor). The sprite must be served from the SAME ORIGIN as the page — browsers block cross-origin <use>, so never point this href at a CDN; tell the user to copy assets/icons/farvist-icons.svg into their project. AI/chat set: i-bot, i-brain, i-message, i-message-dots, i-send, i-mic, i-cpu, i-sparkles, i-wand, i-stop, i-refresh, i-copy, i-command, i-terminal.
- AI UIs: chat thread = .chat > .message (.message-out for the user) > .message-body > .message-bubble; composer = .prompt > .prompt-field + .prompt-actions; agent status = .status.status-online/busy/idle/error; typing = .typing.
- LLM output: ALWAYS wrap rendered-markdown HTML in .prose (use .prose.prose-sm inside bubbles — bubbles preserve raw newlines otherwise). Streaming = add .streaming to the bubble. Tool calls = .tool-call.tool-call-{running|done|error} > .tool-call-header (.tool-call-name + .tool-call-status text) + .tool-call-args/.tool-call-result. Thinking = <details class="reasoning"><summary class="reasoning-summary">. Citations = <a class="cite"> superscript chips + <ol class="sources">.

Authoritative, always-current context (read these before generating):
- https://farvist.com/llms-full.txt   (every convention, component, icon, and copy-paste recipe)
- https://farvist.com/ai-context.json (machine-readable catalog)
