Global CSS Classes
DayFlow provides a set of CSS classes with the df- prefix that allow you to customize the appearance of calendar components. These classes are designed for easy styling customization without modifying the core library.
Choosing the Right CSS Entry
Choose the stylesheet based on whether your app already uses Tailwind CSS:
| Entry | Includes | Use when |
|---|---|---|
styles.css | Full bundle including Tailwind preflight | You are not using Tailwind |
styles.components.css | Component styles only, without CSS reset | You already use Tailwind |
@import '@dayflow/core/dist/styles.components.css';
@import 'tailwindcss';For theme overrides, prefer --df-color-* variables or the stable df-* semantic classes documented below.
Table of Contents
- Common Classes
- Semantic Utility Classes
- Layout & Motion Helpers
- Day View Classes
- Week View Classes
- Month View Classes
- Year View Classes
- Mini Calendar Classes
- Sidebar Classes
- Navigation Classes
- Event Detail Classes
- Content Slot Classes
- Event State Attributes
Common
Common CSS classes used across all calendar views.
| Class Name | Description |
|---|---|
df-calendar-container | Outer root container for the Sidebar and Calendar; supports --df-calendar-height. |
df-calendar | Main calendar container (includes header and view content) |
df-header | Calendar header section (includes title, today button, and view switcher) |
df-header-left | Left section of the header (title and navigation buttons) |
df-header-mid | Middle section of the header (current date range title) |
df-header-right | Right section of the header (view switcher and search) |
df-navigation | Navigation controls container |
df-view-header-container | Shared container used by the secondary view header area |
df-view-header-title | Shared title text class used in view-level headers |
df-view-header-subtitle | Shared subtitle text class used in view-level headers |
df-event | Base class for all events |
df-event-title | Event title text |
df-event-time | Event time text |
df-event-color-bar | Colored bar on the left side of events (Day/Week view) |
df-month-event-color-bar | Colored indicator for regular events (Month view) |
df-all-day-row | All-day event row container |
df-all-day-label | All-day label text |
df-all-day-content | All-day event content area |
df-all-day-cell | Individual all-day event cell |
df-date-number | Date number display |
df-current-time-line | Current time indicator line container |
df-current-time-label | Current time label text |
df-current-time-bar | Current time horizontal line |
df-calendar-checkbox | Shared checkbox style used by calendar lists and related controls |
df-portal | Root scope class used by floating overlays rendered with portals |
df-range-picker | Root scope class used by the range picker popup and trigger wrapper |
Semantic Utility Classes
DayFlow now exposes a stable set of df-* semantic classes for internal states such as selected buttons, highlighted dates, destructive actions, and focus rings. These are defined inside the shared foundation CSS and are safe to target from your own stylesheet.
Use these classes when you want to align custom content, plugin UI, or content-slot output with DayFlow's theme tokens:
| Class Name | Purpose |
|---|---|
df-fill-primary | Primary filled background + matching foreground text |
df-fill-secondary | Secondary filled background + matching foreground text |
df-fill-destructive | Destructive filled background + matching foreground text |
df-tint-primary | Primary 10% tint + primary text |
df-tint-primary-md | Primary 20% tint + primary text |
df-tint-primary-lg | Primary 30% tint + primary text |
df-hover-primary | Primary-tinted hover state |
df-hover-primary-md | Stronger primary-tinted hover state |
df-hover-primary-solid | Solid primary hover state for filled buttons |
df-hover-base | Default hover background using DayFlow's hover token |
df-hover-muted | Muted hover background |
df-hover-destructive | Destructive hover state |
df-text-primary | Primary text color |
df-text-muted | Muted text color |
df-text-primary-fg | Text color for primary-filled backgrounds |
df-text-secondary-fg | Text color for secondary-filled backgrounds |
df-text-destructive | Destructive text color |
df-text-destructive-fg | Text color for destructive-filled backgrounds |
df-bg-base | Base surface background |
df-bg-card | Card surface background |
df-bg-sidebar | Sidebar-style muted background |
df-bg-secondary | Secondary muted background |
df-bg-tertiary | Tertiary background / divider surface |
df-border-base | Base border |
df-border-light | Lighter / softer border |
df-border-strong | Strong border using the primary token |
df-border-primary | Primary border color |
df-border-primary-soft | Softer primary border color |
df-ring-primary | Primary focus/selection ring color |
df-ring-primary-solid | Solid primary ring color |
df-shadow-sm | Small elevation shadow |
df-shadow-md | Medium elevation shadow |
df-shadow-primary | Primary shadow color token |
df-focus-ring | Combined primary border-color + ring-color on :focus |
df-focus-ring-only | Primary ring-color on :focus without changing border color |
df-focus-border-primary | Primary border-color on :focus only |
Prefer these classes or the --df-color-* variables for theming. Avoid targeting old internal combinations such as bg-primary, text-primary, or hover:bg-primary/90 on DayFlow internals, because those Tailwind semantic names are no longer part of the public styling contract.
Layout & Motion Helpers
These classes are useful when you want custom slot content or plugin UI to inherit DayFlow's layout and animation behavior.
| Class Name | Purpose |
|---|---|
df-content-slot-stacked | Makes a content slot fill available height and stack vertically |
df-scrollbar-hide | Hides scrollbars while preserving scroll behavior |
df-animate-in | Base animation timing helper for entry transitions |
df-fade-in | Fade-in animation helper |
df-zoom-in-95 | Slight zoom-in animation helper |
df-animate-slide-up | Slide-up entry animation |
df-animate-slide-down | Slide-down exit animation |
Day View
CSS classes specific to the Day View.
| Class Name | Description |
|---|---|
df-day-view | Day view container |
df-day-event | Individual event in day view |
df-day-time-grid | Time grid container |
df-time-column | Time column (left sidebar with hours) |
df-time-slot | Individual time slot container (left column) |
df-time-label | Time label text (e.g., "1 PM") |
df-time-grid-row | Horizontal row in the time grid |
df-time-grid-cell | Individual cell in the time grid |
df-right-panel | Right panel in day view (mini calendar + event list) |
Week View
CSS classes specific to the Week View.
| Class Name | Description |
|---|---|
df-week-view | Week view container |
df-week-event | Individual event in week view |
df-week-header | Week header container with day names |
df-week-header-row | The sticky header row containing day names |
df-week-day-cell | Individual weekday cell in header |
df-time-column | Time column (left sidebar with hours) |
df-time-slot | Individual time slot container (left column) |
df-time-label | Time label text |
df-time-grid-row | Horizontal row in the time grid |
df-time-grid-cell | Individual cell in the time grid |
Month View
CSS classes specific to the Month View.
| Class Name | Description |
|---|---|
df-month-view | Month view container |
df-month-grid | The main grid container for the month view |
df-month-day-cell | Individual day cell in month view |
df-month-date-number-container | Container for date number area |
df-month-date-number | Date number in month view |
df-month-more-events | "+ x more" indicator for hidden events |
df-month-title | Floating month title during scroll |
Year View
CSS classes specific to the Year View. These are particularly useful for customizing event appearance in the year overview.
| Class Name | Description |
|---|---|
df-year-event | Event outer container - wraps the entire event element |
df-event-year-content | Event content container - contains icon, title, and other content |
df-event-year-title | Event title text - use this to customize title alignment, font, etc. |
df-event-icon-svg | Event icon SVG used across event renderers, including Year view |
df-event-year-indicator | Timed event color indicator - the colored dot/bar for timed events |
df-year-grid-month | Month card container in grid-based Year view |
df-year-fixed-day-cell | Day cell in fixed-week Year view |
Mini Calendar
CSS classes for the Mini Calendar component (usually found in the sidebar or day view).
| Class Name | Description |
|---|---|
df-mini-calendar | Mini calendar container |
df-mini-calendar-body | Mini calendar body wrapper |
df-mini-calendar-header-nav | Month navigation row |
df-mini-calendar-nav-btn | Previous / next month button |
df-mini-calendar-month-label | Current month label |
df-mini-calendar-grid | The grid container for days |
df-mini-calendar-header | Weekday header cell (e.g., "Mo", "Tu") |
df-mini-calendar-day | Base class for a mini calendar date button |
df-mini-calendar-day-cell | Styled date cell surface |
df-mini-calendar-day-number | Numeric day label |
df-mini-calendar-dots | Event-dot container inside a day cell |
df-mini-calendar-dot | Individual event dot |
Sidebar
CSS classes for the sidebar component.
| Class Name | Description |
|---|---|
df-sidebar | Sidebar container |
df-sidebar-header | Sidebar header container |
df-sidebar-toggle | Sidebar collapse/expand toggle button |
df-sidebar-header-title | Sidebar header title ("Calendars") |
df-sidebar-list-shell | Scrollable wrapper around sidebar lists |
df-sidebar-list | Calendar list container |
df-sidebar-list-item | Individual calendar item in list |
df-sidebar-row | Interactive row inside each list item |
df-sidebar-chip | Small sidebar label / chip |
df-sidebar-dialog | Sidebar modal/dialog container |
df-sidebar-button | Shared sidebar button class |
Navigation
CSS classes for navigation buttons.
| Class Name | Description |
|---|---|
df-nav-button | Base navigation arrow button class (prev/next) |
df-calendar-nav-button | Styled calendar navigation arrow button |
df-today-button | Base "Today" button class |
df-calendar-today-button | Styled calendar "Today" button |
Event Detail
CSS classes for event detail panels and dialogs.
| Class Name | Description |
|---|---|
df-event-detail-panel | Floating event detail panel |
df-event-dialog-overlay | Event detail dialog overlay root |
df-event-dialog-backdrop | Event detail dialog backdrop |
df-dialog-container | Dialog content container |
df-event-dialog-close | Event detail dialog close button |
df-portal | Shared portal root class |
Content Slots
CSS classes used for the Content Slot rendering system.
| Class Name | Description |
|---|---|
df-content-slot | Container for a content slot |
df-slot-[id] | Dynamic class assigned to a specific slot instance where [id] is a unique identifier |
Event State Attributes
DayFlow exposes more than just event state flags. Across events, grids, overlays, drawers, and internal layout helpers, the current project uses the following data-* attributes. You can target many of them in CSS directly, while a few are primarily structural hooks for overlay logic and click-outside handling.
Event Elements
| Attribute | Values | Description |
|---|---|---|
data-view | "day" "week" "month" "year" "agenda" | Which view is currently rendering the event or event fragment |
data-all-day | "true" "false" | Whether the event is an all-day event |
data-selected | "true" "false" | Whether the event is currently selected |
data-dragging | "true" "false" | Whether the event is currently being dragged |
data-resizing | "true" "false" | Whether the event is currently being resized |
data-popping | "true" "false" | Whether the event is visually popped / elevated during interaction |
data-editable | "true" "false" | Whether the event is editable from built-in UI |
data-viewable | "true" "false" | Whether the event detail UI may be opened |
data-draggable | "true" "false" | Whether dragging is enabled for that event |
data-multi-day | "true" "false" | Whether the event spans multiple days |
data-month-stack | "true" "false" | Whether the event is rendered inside the Month view stacked layout |
data-touch-handles | "true" "false" | Whether touch resize handles should be visible / reserved |
data-axis | View-specific keywords | Orientation hint used by compact/timed event renderers |
data-density | View-specific keywords | Density hint used by compact event content |
data-position | View-specific keywords | Positional hint for segmented or compact event renderers |
data-segment-shape | "full" "start" "middle" "end" | Rounded-corner shape for multi-segment events |
data-segment-days | Numeric string | Number of days represented by a rendered month-view event segment |
data-event-id | Event id string | Raw event identifier attached to interactive event / panel anchor nodes |
data-continued-left | "true" "false" | Agenda all-day badge continues from a previous day |
data-continued-right | "true" "false" | Agenda all-day badge continues into a following day |
Date, Grid, and Layout State
| Attribute | Values | Description |
|---|---|---|
data-today | "true" "false" | Marks a date, section, or header cell representing today |
data-other-month | "true" "false" | Marks dates that belong to the previous / next month |
data-current-month | "true" "false" | Marks dates rendered inside the current month range |
data-date | Date string | Concrete date payload attached to grid / year cells |
data-first-day | "true" "false" | Marks the first visible day in a grouped year or month structure |
data-weekend | "true" "false" | Marks weekend cells / labels |
data-has-events | "true" "false" | Marks grid cells that contain one or more events |
data-heat-level | Numeric string | Heatmap intensity level used by grid-based Year view |
data-visible | "true" "false" | Generic visibility flag used by virtual / conditional layouts |
data-layout | Layout keyword | Internal layout mode marker used by month / virtual scroll rendering |
data-layout-ready | "true" "false" | Whether a virtualized layout has completed its first measurement pass |
data-trailing-border | "true" "false" | Whether a month cell should render the trailing border |
data-scrollbar-space | "true" "false" | Whether a view reserves room for a scrollbar |
data-secondary-tz | "true" "false" | Whether a secondary timezone axis is active |
data-show-all-day | "true" "false" | Whether the all-day row is currently enabled |
data-sliding-view | "true" "false" | Whether a view is in a sliding / transition state |
data-mobile | "true" "false" | Mobile-mode rendering hint used by some compact view fragments |
data-switcher-mode | "buttons" "select" | Which built-in view switcher mode is active |
data-inside-pill | "true" "false" | Whether compact header content is currently rendered inside the today pill |
data-sidebar-collapsed | "true" "false" | Whether the sidebar is collapsed |
data-sidebar-enabled | "true" "false" | Whether the calendar shell is currently mounted with the sidebar plugin |
data-df-theme | Theme keyword | Theme marker emitted by themed layout wrappers |
Controls, Inputs, and Search
| Attribute | Values | Description |
|---|---|---|
data-active | "true" "false" | Generic active-state marker for switches, tabs, and picker controls |
data-open | "true" "false" | Whether a dropdown, drawer, or search surface is currently open |
data-bordered | "true" "false" | Whether the header should render its bottom border |
data-loading | "true" "false" | Loading state for async buttons / actions |
data-ready | "true" "false" | Whether a quick-create overlay has completed initial positioning |
data-placement | Placement keyword | Placement hint for popup / quick-create alignment |
data-checked | "true" "false" | Checked state for custom switches |
data-disabled | "true" "false" | Disabled state for custom switches / inputs |
data-kind | Component-specific keyword | Section / field kind marker used by the mobile event drawer |
data-expanded | "true" "false" | Expanded / collapsed state for drawer sections |
data-closing | "true" "false" | Marks the mobile drawer during its closing transition |
data-tone | "default" "today" "upcoming" | Semantic tone used by grouped search result date headers |
data-mini-calendar-dot | Present attribute | Marker attached to mini-calendar event dots |
Sidebar Plugin State
| Attribute | Values | Description |
|---|---|---|
data-active | "true" "false" | Highlights the active calendar row in the sidebar list |
data-collapsed | "true" "false" | Whether a sidebar source group or chevron-controlled panel is collapsed |
data-draggable | "true" "false" | Whether a sidebar calendar item can be dragged |
data-dragging | "true" "false" | Whether a sidebar calendar item is currently being dragged |
data-position | "top" "bottom" | Drop-indicator position used while dragging calendars within the sidebar |
data-selected | "true" "false" | Selected option state inside sidebar dropdowns / import dialogs |
data-submenu-content | Present attribute | Marks sidebar submenu portal content (for merge menus and related overlays) |
Overlays and Interaction Hooks
| Attribute | Values | Description |
|---|---|---|
data-event-detail-panel | Present attribute | Marks the floating event detail panel root |
data-event-detail-dialog | Present attribute | Marks the modal event detail dialog root |
data-range-picker-popup | Present attribute | Marks the range picker popup root |
data-calendar-picker-dropdown | Present attribute | Marks the calendar picker dropdown root |
data-grid-day-cell | Present attribute | Marks clickable day cells in grid-based Year view |
data-grid-day-popup | Present attribute | Marks the Year view day popup root |
Example
/* Selected events */
.df-event[data-selected='true'] {
outline: 2px solid var(--df-color-primary);
}
/* Events while being dragged */
.df-event[data-dragging='true'] {
opacity: 0.6;
}
/* Only target month-view events */
.df-event[data-view='month'] {
font-size: 11px;
}
/* All-day events only */
.df-event[data-all-day='true'] {
font-weight: 600;
}
/* Highlight today's agenda section or compact grid cell */
[data-today='true'] {
background-color: color-mix(in srgb, var(--df-color-primary) 8%, transparent);
}How to Customize
To customize the appearance, target these classes or override the --df-color-* variables in your global CSS. Most theme-level changes should not need !important; use it only when you intentionally want to beat a highly specific local rule.
Example
/* Change the background of all events */
.df-event {
border-radius: 8px !important;
}
/* Customize the current time indicator */
.df-current-time-line {
z-index: 100;
}
.df-current-time-bar {
height: 3px !important;
background-color: #ef4444 !important;
}
/* Customize specific view */
.df-day-view .df-event {
border-left: 4px solid #3b82f6;
}
/* Style the sidebar */
.df-sidebar {
background-color: #f8fafc !important;
}
/* Style mini calendar */
.df-mini-calendar-day:hover {
background-color: #e2e8f0;
}
/* Reuse DayFlow semantic helpers in your own slot or plugin markup */
.my-custom-primary-chip {
background-color: var(--df-color-primary);
color: var(--df-color-primary-foreground);
}
/* Dark mode overrides */
.dark .df-calendar {
background-color: #111827;
}
/* Style event detail panel */
.df-event-detail-panel {
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}Usage Tips
-
Specificity: If your styles don't apply, increase specificity by wrapping the calendar in a custom class:
.my-custom-calendar .df-event { ... } -
Responsive Design: Use media queries to adjust styles for mobile devices:
@media (max-width: 768px) { .df-event-title { font-size: 10px; } .df-time-label { font-size: 10px; } } -
Dark Mode: Use the
.darkselector for dark mode specific styles:.dark .df-month-day-cell { border-color: #374151; } -
CSS Variables: DayFlow uses
--df-color-*custom properties for colors. Override them on.df-calendar-container(and.df-portalfor floating overlays) for scoped color changes:.df-calendar-container, .df-portal { --df-color-primary: #3b82f6; --df-color-primary-foreground: #ffffff; }
Upgrading from Earlier Versions
Breaking change: calendar-event class removed
The calendar-event class has been removed from event elements. If your stylesheet targets .calendar-event { ... }, update it to .df-event { ... }.
Internal Tailwind utility classes (flex, rounded-md, shadow-sm, etc.) that were previously present on DayFlow DOM elements have also been removed. These were never part of the public API. Use the documented df-* classes and data-* attributes for all CSS customization.
Related Documentation
- Theme Customization - Advanced theming options
- Dark Mode - Dark mode configuration