event_styles configuration lets you define a list of rules that change how individual events look on your calendar. Each rule specifies which events to target through a match object and how to style them through a style object. When multiple rules match the same event, the rule with the highest priority value wins. This makes it easy to build layered styling — for example, dimming all past events while still highlighting specific recurring ones at a higher priority.
Rule Structure
Each entry inevent_styles is a rule with three top-level keys:
match— describes which events the rule applies tostyle— describes how matching events should lookpriority— optional integer (default0) that controls which rule wins when multiple rules match the same event
Match Fields
Use one or more of the following fields in thematch object. By default, an event must satisfy all specified fields to be considered a match. For OR / NOT logic, use the logical operators below.
The entity ID of a specific Home Assistant calendar. Only events from that calendar entity will match.
A substring to look for in the event title. The match is case-insensitive. You can also pass a regex pattern wrapped in forward slashes, e.g.
/standup/i.Alias for
match.title. Both names map to the event summary field. Use whichever feels more natural.A substring to look for in the event description field.
A substring to look for in the event location field.
When
true, only matches all-day events. When false, only matches timed events.When
true, only matches events whose end time is in the past. When false, only matches events that are not yet past.Logical Operators
For compound rules,match accepts three logical operator keys. Each operator takes either a single sub-condition object or an array of sub-condition objects, and sub-conditions use the same match-field syntax as a top-level match block — including nested operators.
OR logic. The rule matches when at least one of the listed sub-conditions matches.
AND logic. The rule matches when all listed sub-conditions match. Same as combining fields at the top level, but useful when nesting inside
any or not.Alias for
match.all.NOT logic. The rule matches when the listed sub-condition (or none of the listed sub-conditions) matches.
Example: events on the work OR personal calendar
Example: all-day events that are NOT in the past
Style Fields
Thestyle object accepts the following properties to control how matched events are rendered.
Alias for
style.background_color. Hex color string (e.g. '#1565C0') applied to the event’s background or bar color.Hex color string applied to the event’s background or bar color. Equivalent to
style.color.Hex color string applied to the event’s text. Use this to ensure readable contrast when you change the background color.
A number between
0 and 1 that controls the event’s transparency. Use 0.4 to visually mute events without hiding them entirely.A CSS filter string applied to the event element. For example,
grayscale(100%) removes all color from matching events.An MDI icon name (e.g.
mdi:repeat) to attach to matching events. Combine with icon_position to control placement.Controls where the icon is rendered. Use
before_title to place it inline before the event title, or corner to display it as a small overlay in the corner of the event chip.Hex color string applied to the matched style icon. Defaults to the event’s text color.
Overrides the icon size. Accepts a number (interpreted as pixels) or any CSS length string such as
'14px' or '1.1em'.When
true, matching events are completely removed from the calendar view. Hidden events are not counted toward day event totals.When
true, suppresses the time label on matching events even if times would otherwise be shown.When
true, forces the time label to render on matching events even if it would otherwise be hidden (for example, by hide_times_for_calendars).When
true, hides the small calendar-color dot on matching events. Useful when you’ve added a custom icon and don’t want the default indicator competing with it.Per-rule override of the global
show_event_location setting. Set to true to force locations on for matching events, or false to hide them on matching events only.Per-rule override of the global
use_short_location setting.Per-rule override of the event title font size. Accepts a number (pixels) or CSS length string.
Per-rule override of the event time font size. Accepts a number (pixels) or CSS length string.
Per-rule override of the event location font size. Accepts a number (pixels) or CSS length string.
Per-rule override of the global
event_title_prefix mode. Accepted values: none, badge_icon, friendly_name.Priority
When two or more rules match the same event, the rule with the highest
priority integer is applied. Rules with the same priority follow the order they are defined in the list (earlier rules win).Examples
Color all events from a work calendar
This rule applies a deep blue background and white text to every event fromcalendar.work.
Hide events titled “Free”
This rule completely removes any event whose title contains the word “Free” from the calendar view.Add a corner icon to a specific calendar’s events
This rule stamps a briefcase icon in the corner of every event fromcalendar.work. A priority of 5 ensures it takes precedence over lower-priority color rules.
Mute all-day events with opacity
This rule reduces the opacity of all-day events to0.4, visually de-emphasizing them without hiding them.
Dim past events
This rule applies a grayscale filter and reduced opacity to any event that has already passed, giving the calendar a clear visual split between past and upcoming.Combine multiple match conditions
You can narrow a rule by specifying more than one match field at the same time. This rule applies a grayscale filter only to past all-day events from a specific calendar.All style values are sanitized before they are applied to the DOM. Attempting to inject HTML or JavaScript through a
color, filter, or other style field will be stripped out automatically.