Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

calendar-event

Styled event block for day, hour, and week schedule views. CSS-only custom element with category colors, icons, and duration support.

Overview

The <calendar-event> element is a CSS-only custom element for displaying events inside schedule views. Its own styling — category colors, the inline-start accent bar, icons, half-hour placement, and expandable details — needs no JavaScript. Events that span several hours (data-duration) are positioned by the parent view's JavaScript.

Used by:

  • <day-view>, inside an <hour-view> per hour, or as loose children in auto mode (data-start-hour="auto").
  • <week-view>, as loose children with data-date; the component builds the table.
  • <calendar-wc>, which builds them for its day-detail timeline from timed events.

Attributes

AttributeValuesDescription
data-category meeting, deadline, personal, focus, or your own Sets --event-color for the accent bar and background tint.
data-start 30 Places a single-hour event in the bottom half of its hour row. Auto modes set it for you when the start <time> is at :30 or later.
data-duration Hours and/or minutes: 2h, 45m, 1h30m, 90m Event length. <day-view> and <week-view> read it and position the event absolutely across hour rows. Any combination of a number followed by h and/or a number followed by m works; anything else falls back to one hour. Without the parent view's JavaScript the event stays in its starting hour.
data-date ISO date, e.g. 2026-04-07 Day the event belongs to. Required for <week-view> auto mode, which places the event in that day's column. Ignored by <day-view>.

Content

Events can contain any combination of:

ElementPurpose
<time datetime="HH:MM">Start time, shown as a label. The first <time datetime> is what auto modes use to place the event in its hour.
<time datetime="PT1H">Optional human-readable duration. Hidden visually but still read by screen readers. It does not position anything — use data-duration for that.
<icon-wc>Event icon
<a href> or <button>The action, when the event is actionable (see Interaction).
<details>Expandable extra information, on its own line
Text contentEvent title. It stays on one line and ends in an ellipsis when it does not fit.

Events Without a Time

In <day-view> auto mode, an event with no <time datetime> is moved into an all-day list (<ul class="all-day-events">) above the hour grid. In <week-view> auto mode, events need both data-date and a start <time>; others are left out of the table.

Interaction

The event block itself is not a control. <day-view> and <week-view> make events focusable for arrow-key browsing and emit an event-click event on pointer clicks, but a keyboard user cannot activate a bare <calendar-event>. When an event should do something, put an <a href> or <button> inside it: only then does the block show a pointer cursor and hover tint.

Category Colors

Each category sets a --event-color custom property that controls the inline-start accent bar (left in left-to-right text, right in right-to-left) and the background tint.

CategoryColor
meeting--color-primary
deadline--color-error
personal--color-success
focus--color-warning

Add custom categories via CSS: calendar-event[data-category="workshop"] { --event-color: purple; }

Right-to-Left

The accent bar and spanning-event positions use logical properties, so events mirror correctly under dir="rtl".

Related

  • <hour-view> — Container for events within an hour
  • <day-view> — Full day schedule using these events
  • <week-view> — Seven-day time grid using these events
  • <calendar-wc> — Month calendar whose day detail renders these events
↑