# CalendarDay

> One day in a Calendar: a 40px square with its number. Green when picked, green text for today, grey for the months either side, faint when it can't be picked.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [calendar-day.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/calendar-day.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 750:32](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=750-32) · read 2026-11-17 · frozen 2026-11-17 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/calendar-day/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add calendar-day
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `status` | enum | `default` `outside` `today` `selected` `disabled` `range` | `default` |
| `children` | slot |  |  |

## States

`Default` · `Hover` · `Focus`

## Anatomy

- `root`: A `<button>`, 40px square with 8px corners, the number in the middle in paragraph type.

## When to use

- **Picked and today.** The picked day is filled green. Today is green text in medium weight, so it's found without being mistaken for the pick.
- **A range.** Both ends are filled green as a picked day is, and the days between them a dark green, so the stretch reads as one.

## When not to use

- **On its own.** A CalendarDay only makes sense in a Calendar, which sets its status and moves the focus between days.

## Behaviour

A day from either side of the month is grey and can still be picked; it moves the Calendar to that month. A disabled day can be reached with the keyboard, so the grid has no holes, but pressing it does nothing.

## Accessibility

- **Element**: `<button>` inside a `gridcell`. Its name is the whole date in the locale's words, like November 17, 2026. The picked one has `aria-selected`, today `aria-current="date"`, a disabled one `aria-disabled`.
- **Colour**: The numbers are 17:1, the grey ones 7:1 and today's green 10:1 on the dark page. Disabled days are faint on purpose, 1.8:1, and not counted.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `calendar-day/default/label` | `#ededed` |
| `calendar-day/disabled/label` | `#3a3a3a` |
| `calendar-day/hover/background` | `#006f27` |
| `calendar-day/hover/label` | `#ededed` |
| `calendar-day/outside/label` | `#999999` |
| `calendar-day/range/background` | `#004c19` |
| `calendar-day/range/label` | `#ededed` |
| `calendar-day/selected/background` | `#00d669` |
| `calendar-day/selected/label` | `#060805` |
| `calendar-day/today/label` | `#00d669` |
| `font-family/base` | `'General Sans Variable'` |
| `spacing/gap/none` | `0px` |
| `spacing/radius/small` | `8px` |
| `spacing/size/medium` | `40px` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/medium` | `500` |
| `typography/paragraph/font-weight/regular` | `400` |
| `typography/paragraph/letter-spacing` | `0px` |
| `typography/paragraph/line-height` | `20px` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `root` | `outline` | `var(--spacing-outline-medium) solid var(--calendar-day-focus-ring)` | Composed from tokens: a 2px ring in calendar-day/focus-ring. |
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-medium))` | Composed from a token: the ring sits inside the square. |
| `root` | `outline` | `var(--spacing-outline-medium) solid var(--calendar-day-focus-ring)` | Composed from tokens: a 2px ring in calendar-day/focus-ring. |
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-medium))` | Composed from a token: the ring sits inside the square. |
| `root` | `outline` | `var(--spacing-outline-medium) solid var(--calendar-day-focus-ring)` | Composed from tokens: a 2px ring in calendar-day/focus-ring. |
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-medium))` | Composed from a token: the ring sits inside the square. |
| `root` | `outline` | `var(--spacing-outline-medium) solid var(--calendar-day-focus-ring)` | Composed from tokens: a 2px ring in calendar-day/focus-ring. |
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-medium))` | Composed from a token: the ring sits inside the square. |
| `root` | `outline` | `var(--spacing-outline-medium) solid var(--calendar-day-selected-focus-ring)` | Composed from tokens: a 2px ring in calendar-day/selected/focus-ring, the picked day's own label colour, since the grey ring is 1.4:1 on the green. |
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-large))` | Composed from a token: on the green, the ring sits 2px further in, so the green shows round it. |
| `root` | `outline` | `var(--spacing-outline-medium) solid var(--calendar-day-focus-ring)` | Composed from tokens: a 2px ring in calendar-day/focus-ring. |
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-medium))` | Composed from a token: the ring sits inside the square. |

See it live, with every value of every variant: [rost.build/components/calendar/#calendar-day](https://rost.build/components/calendar/#calendar-day)
