# Occasion — the app dresses for the day it's for

> The app is FOR an occasion or a theme — Halloween, Christmas, Hanukkah, Diwali, Lunar New Year, Thanksgiving, Valentine's, a birthday party, a wedding, a baby shower, game day, a pirate or dinosaur party — even when the person describes no appearance: the occasion is the style, so the app wears its palette, a display face, its objects as motifs, a hero that sets the scene and words in the day's voice, by the reskin technique

Source: https://good.vibes.diy/docs/reference/occasion

When the app is FOR an occasion — a holiday, a season, a party, a ceremony, a
big game, a themed event — the occasion is its style. The person who asks for
a Halloween thing, a winter-holiday thing or a kid's birthday thing has
already told you how it should look and sound: like that day. Someone glancing
at the screen from across the room should be able to name the occasion.

The app wears it with the reskin technique (the reskin doc loads with this
one): one `data-reskin` wrapper re-scoping the look's tokens, one `SKIN`
string rendered as its first child, every component, prop and record
untouched. The occasion leads everything the look and the first look
suggested: their colours were a starting sketch, the occasion's are the app's.

## Dress all five layers

**1. Palette — the colours a stranger names for the day.** Set them on the
wrapper's tokens (`--bg --surface --ink --text-secondary --purple
--on-accent --orange --info`): Halloween is a night ground of deep violet-black,
pumpkin orange for the lead, bone-white ink and a candle-gold highlight; the
winter holidays are pine green, cranberry red, snow and gold; a kid's birthday
is bright frosting colours on white; a wedding is ivory, ink and one metallic.
A dark ground re-declares the composite surfaces too (`--ui-card --ui-row
--ui-control --ui-field` …), trading drop shadows for a soft glow in the lead
colour, and keeps ink on every fill at 4.5:1.

**2. Type — one display face that says the day.** A Google Font loaded by
`@import` in the `SKIN`, on `.ui-h1 .ui-h2 .ui-eyebrow` and the hero: a
spooky hand for Halloween (`Creepster`, `Butcherman`, or a softer `Fredoka`
for a family night), a storybook serif for the holidays, a round bubbly face
for a kid's party, an elegant serif or script for a wedding. The heading face
reads the Font card's pick first, `var(--font-pick, 'Creepster', cursive)`, so
a font picked in the Look tab reaches the headings too. Body text stays on a
plain readable face.

**3. Motif — the day's objects, repeated.** Pick the two or three things
everyone pictures (pumpkins, bats, candy; snowflakes, lights, ribbon;
balloons, candles, confetti) and use them as the app's ornament: in the hero,
as list bullets and map pins, on the empty state, in a divider row, as a CSS
pattern on the ground (a sky of small stars, falling snow, scattered
confetti). Emoji and small inline SVGs both work. One motif repeated
everywhere beats many scattered once.

**4. Words — the occasion's voice where people read for feeling.** The
headline, the eyebrow, the hero line, button labels, empty states, success
messages and the footer all speak the day, warm and a little playful: "Light
up your porch" for adding a house, "Your sleigh list" for a gift list, "Save
me a slice" for an RSVP. Field labels and data stay plain, so the form is
easy to fill: the voice lives in headings, calls to action and the quiet
moments around them.

**5. Moment — a hero that sets the scene.** The first screen opens on the
occasion: its name or a one-line welcome in the display face, the date line
("October 31 · porch lights from 5"), a sentence promising the good time, and
the main action right there. Below it, the app's real work.

An app that already has a style the person described keeps theirs: the
occasion fills in whatever they left open.

## A New Year's Eve countdown board

**Asked as:** "a board for our new year's eve party where friends post their
resolutions and we count down together". Midnight blue ground, champagne gold
lead, a serif display face, a starfield ground, a live countdown in the hero,
gold sparkle bullets, and words that toast the night.

### `App.jsx`
```jsx
import React, { useEffect, useState } from "react";
import { useFireproof } from "use-fireproof";
import { useVibe } from "use-vibes";
import { Button, Card, Empty, Field, Heading, Input, Row, RowCard, Skeleton, Stack, Text } from "@vibes.diy/ui";

const SKIN = `
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,500&family=Inter:wght@400;600&display=swap');
[data-reskin], body:has([data-reskin]) {
  --bg: #0b1026; --surface: #141b3d; --ink: #f6f1e3; --text-secondary: #b9b4c9;
  --purple: #e8c66a; --on-accent: #1a1405; --orange: #f2a65a; --info: #8fb8ff;
  --font-family: 'Inter', system-ui, sans-serif;
  --ui-card: 0 0 0 1px #e8c66a33, 0 8px 30px #e8c66a14; --ui-row: 0 0 0 1px #e8c66a26;
  --ui-row-hover: 0 0 0 1px #e8c66a66; --ui-control: 0 0 18px #e8c66a40; --ui-control-active: 0 0 8px #e8c66a40;
  --ui-field: inset 0 0 0 1px #b9b4c966; --ui-field-focus: inset 0 0 0 2px #e8c66a; --ui-blob: none;
  min-height: 100vh; color: var(--ink); font-family: var(--font-family);
  background: radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent), radial-gradient(1px 1px at 70% 15%, #fff6 50%, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #e8c66a99 50%, transparent), radial-gradient(1px 1px at 85% 60%, #fff7 50%, transparent), var(--bg);
  background-size: 180px 180px, 220px 220px, 260px 260px, 200px 200px, auto;
}
[data-reskin] .ui-h1, [data-reskin] .ui-h2, [data-reskin] .hero-when { font-family: var(--font-pick, 'Playfair Display', serif); }
[data-reskin] .hero { text-align: center; padding: 48px 16px 24px; }
[data-reskin] .hero-when { font-style: italic; color: var(--purple); font-size: 20px; }
[data-reskin] .clock { font-family: 'Playfair Display', serif; font-size: clamp(40px, 12vw, 88px); color: var(--purple); letter-spacing: 0.04em; }
[data-reskin] .sparkle::before { content: "✦ "; color: var(--purple); }
`;

// The midnight this party counts down to, fixed once: it reaches zero and stays there.
const MIDNIGHT = new Date(new Date().getFullYear() + 1, 0, 1);

function untilMidnight() {
  const s = Math.max(0, Math.floor((MIDNIGHT - new Date()) / 1000));
  if (s === 0) return "Happy new year!";
  const pad = (n) => String(n).padStart(2, "0");
  return `${Math.floor(s / 86400)}d ${pad(Math.floor(s / 3600) % 24)}:${pad(Math.floor(s / 60) % 60)}:${pad(s % 60)}`;
}

export default function App() {
  const { database, useLiveQuery } = useFireproof("midnight");
  const { docs } = useLiveQuery("type", { key: "resolution" });
  const { can, me } = useVibe("midnight");
  const [text, setText] = useState("");
  const [clock, setClock] = useState(untilMidnight);
  const canPost = can.create({ type: "resolution", authorHandle: me?.userHandle });

  useEffect(() => {
    const t = setInterval(() => setClock(untilMidnight()), 1000);
    return () => clearInterval(t);
  }, []);

  async function post(e) {
    e.preventDefault();
    const value = text.trim();
    if (value === "") return;
    setText("");
    await database.put({ type: "resolution", text: value, createdAt: Date.now(), authorHandle: me?.userHandle });
  }

  return (
    <div data-reskin>
      <style>{SKIN}</style>
      <header className="hero">
        <Heading level={1}>Here's to the new year</Heading>
        <p className="hero-when">December 31 · glasses up at midnight</p>
        <div className="clock" aria-live="off">{clock}</div>
      </header>
      <Stack gap={4}>
        {canPost.pending ? (
          <div aria-busy="true">
            <Skeleton variant="card" />
          </div>
        ) : canPost.ok ? (
          <Card>
            <form onSubmit={post}>
              <Stack gap={3}>
                <Field label="Your resolution">
                  {(id, describedBy) => <Input id={id} describedBy={describedBy} value={text} onChange={setText} />}
                </Field>
                <Row justify="end">
                  <Button type="submit">Raise a glass to it</Button>
                </Row>
              </Stack>
            </form>
          </Card>
        ) : (
          <Text muted>Resolutions open up once you're on the guest list.</Text>
        )}
        <Heading level={2}>The toast list</Heading>
        {docs.length === 0 ? (
          <Empty title="The first toast is yours">Post a resolution and the board starts to sparkle.</Empty>
        ) : (
          <Stack gap={2}>
            {docs.map((r) => (
              <RowCard key={r._id}>
                <Text>
                  <span className="sparkle">{r.text}</span>
                </Text>
              </RowCard>
            ))}
          </Stack>
        )}
      </Stack>
    </div>
  );
}
```

## Reading an occasion nobody names outright

Some asks carry their occasion in a detail: a costume contest, a gift
exchange with a spending limit, a bracket for a big game, a menu for a
harvest dinner, a treasure hunt with clues. Name the day those details point
to and dress for it. A theme that is an idea rather than a date (pirates,
outer space, dinosaurs, a fairy garden) is dressed the same way: its palette,
its face, its objects and its voice.
