# Schedule foundations
> What @sdxc/ui/schedule is for, the rules its parts share, and every variable it reads.

The parts of a calendar app: a time grid of days and hours, a month, an agenda, a phone's strip of days, and a people-by-hours grid for finding a time.

They draw what the server places: days are `YYYY-MM-DD` strings and times are minutes of the day, so the app decides the zone and the parts never guess it.

Import the components from `@sdxc/ui/schedule` and the theme once from `@sdxc/ui/theme.css`.

## When to reach for it

- A day, three-day or week calendar whose events can be dragged, resized and created.
- A month or agenda over the same events, and a phone layout with a strip of dates.
- Comparing several people's busy times to offer a meeting slot.

## Shared ideas

- **Placed on the server.** Overlapping events split their cluster into columns, and all-day spans stack into rows, before any script runs.
- **Edits post forms.** A drag or an Alt+arrow move fills the grid's `edit` form with `date`, `start` and `end`, so a no-script form does the same job.
- **Zones as columns.** Each zone is a column of hour labels the app reads for that day, so a second zone shows its own DST offset.
- **A moving now line.** The server draws the present minute, and the island moves it on from the instant it was read, even on a cached page.
- **Opens on the day.** The grid opens scrolled to `scrollTo`, and keeps its scroll when a post redraws it.
- **Phones get their own view.** `DayStrip` scrolls inside its own box, and a month narrows its days to dots without widening the page.

## CSS variables

Every custom property the namespace reads or declares. Reads the neutral role for hairlines, labels and off-hours tint, and brand for today, the current day and a default event colour; each event tints itself from its own colour. The roles are documented on Theming.

### Scale and colour

None is declared in `theme.css`; set any of them on a part or an ancestor.

| Variable | Default | What it controls |
| --- | --- | --- |
| `--ui-time-grid-hour` | `3rem` | One hour's height in a `TimeGrid`, which every event's offset and length multiplies. |
| `--ui-time-grid-gutter` | `3.5rem` | The width of each time zone's column of hour labels. |
| `--ui-time-grid-now` | `var(--ui-danger-bg-solid)` | The now line and its dot. |
| `--ui-day-strip-cell` | `3rem` | The width of each day in a `DayStrip`; widen it for longer notes such as amounts. |
